sweet! can now update transactions

This commit is contained in:
Annika
2022-07-12 11:48:40 -06:00
parent 6455c02d5e
commit ef06dd057a
6 changed files with 78 additions and 16 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ AuthService.on(AuthService.AUTH_EVENTS.AUTHENTICATED, async function() {
AppState.user = AuthService.user
await accountService.getAccount()
socketService.authenticate(AuthService.bearer)
// NOTE if there is something you want to do once the user is authenticated, place that here
// NOTE if there is something you want to do once the user is authenticated, place that here (!!!)
})
async function refreshAuthToken(config) {
@@ -17,6 +17,14 @@ class TransactionsService {
// logger.log('transactions: ' + res.data)
AppState.transactions = res.data
}
// TODO test this
async update(transaction) {
console.log(transaction._id)
const res = await api.put('api/transactions/' + transaction._id, transaction)
console.log('transactionUpdate: ' + res.data)
// AppState.transactions.find((t) => t._id == transactionId) = res.data
}
}
export const transactionsService = new TransactionsService()