Fixed usages with profile store in api.
Build and Deploy Web App / build-and-deploy (push) Successful in 19s
Details
Build and Deploy Web App / build-and-deploy (push) Successful in 19s
Details
This commit is contained in:
parent
ca87d2723c
commit
05820e6e0e
|
|
@ -17,14 +17,9 @@ const profileStore = useProfileStore()
|
|||
const transaction: Ref<TransactionDetail | undefined> = ref()
|
||||
|
||||
onMounted(async () => {
|
||||
if (!profileStore.state) {
|
||||
await router.replace('/')
|
||||
return
|
||||
}
|
||||
|
||||
const transactionId = parseInt(route.params.id as string)
|
||||
try {
|
||||
const api = new TransactionApiClient(profileStore.state)
|
||||
const api = new TransactionApiClient()
|
||||
transaction.value = await api.getTransaction(transactionId)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
|
|
@ -40,7 +35,7 @@ async function deleteTransaction() {
|
|||
const conf = await showConfirm('Are you sure you want to delete this transaction? This will permanently delete all data pertaining to this transaction, and it cannot be recovered.')
|
||||
if (!conf) return
|
||||
try {
|
||||
await new TransactionApiClient(profileStore.state).deleteTransaction(transaction.value.id)
|
||||
await new TransactionApiClient().deleteTransaction(transaction.value.id)
|
||||
await router.replace(`/profiles/${profileStore.state.name}`)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ onMounted(async () => {
|
|||
})
|
||||
|
||||
async function fetchPage(pageRequest: PageRequest) {
|
||||
if (!profileStore.state) return
|
||||
const api = new TransactionApiClient(profileStore.state)
|
||||
const api = new TransactionApiClient()
|
||||
try {
|
||||
transactions.value = await api.getTransactions(pageRequest)
|
||||
} catch (err) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue