Fixed usages with profile store in api.
Build and Deploy Web App / build-and-deploy (push) Successful in 19s Details

This commit is contained in:
andrewlalis 2025-08-22 21:07:18 -04:00
parent ca87d2723c
commit 05820e6e0e
2 changed files with 3 additions and 9 deletions

View File

@ -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)

View File

@ -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) {