sweet! can now update transactions
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user