diff --git a/web-app/src/pages/TransactionPage.vue b/web-app/src/pages/TransactionPage.vue index 833a07e..a738b50 100644 --- a/web-app/src/pages/TransactionPage.vue +++ b/web-app/src/pages/TransactionPage.vue @@ -17,14 +17,9 @@ const profileStore = useProfileStore() const transaction: Ref = 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) diff --git a/web-app/src/pages/home/TransactionsModule.vue b/web-app/src/pages/home/TransactionsModule.vue index 75d4164..38137d1 100644 --- a/web-app/src/pages/home/TransactionsModule.vue +++ b/web-app/src/pages/home/TransactionsModule.vue @@ -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) {