Bugfixes
This commit is contained in:
@ -4,6 +4,7 @@ import { defineComponent } from "vue"
|
||||
import Autocomplete, { Suggestion } from '../components/Autocomplete.vue'
|
||||
import Currency from "../components/Currency.vue";
|
||||
import TransactionRow from "../components/TransactionRow.vue";
|
||||
import { useAPI } from "../stores/api";
|
||||
import { useAccountStore } from "../stores/budget-account";
|
||||
import { useSessionStore } from "../stores/session";
|
||||
|
||||
@ -25,9 +26,8 @@ export default defineComponent({
|
||||
methods: {
|
||||
saveTransaction(e : MouseEvent) {
|
||||
e.preventDefault();
|
||||
fetch("/api/v1/transaction/new", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
const api = useAPI();
|
||||
api.POST("/transaction/new", JSON.stringify({
|
||||
budget_id: this.budgetid,
|
||||
account_id: this.accountid,
|
||||
date: this.$data.TransactionDate,
|
||||
@ -36,9 +36,7 @@ export default defineComponent({
|
||||
memo: this.$data.Memo,
|
||||
amount: this.$data.Amount,
|
||||
state: "Uncleared"
|
||||
}),
|
||||
headers: useSessionStore().AuthHeaders,
|
||||
})
|
||||
}))
|
||||
.then(x => x.json());
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user