Implement Delete Budget

This commit is contained in:
2022-01-31 15:50:13 +00:00
parent 1be3b6930d
commit 95b1ac5943
5 changed files with 58 additions and 3 deletions

View File

@ -23,6 +23,14 @@ export default {
gotTransactions(e) {
this.$data.transactionsFile = e.target.files[0];
},
deleteBudget() {
fetch("/api/v1/budget/" + this.$store.getters.CurrentBudget.ID, {
method: "DELETE",
headers: {
'Authorization': 'Bearer ' + this.$store.state.Session.Token
},
})
},
clearBudget() {
fetch("/api/v1/budget/" + this.$store.getters.CurrentBudget.ID + "/settings/clear", {
method: "POST",
@ -65,6 +73,23 @@ export default {
</v-card-actions>
</v-card>
</v-col>
<v-col cols="12" md="6" xl="3">
<v-card>
<v-card-header>
<v-card-header-text>
<v-card-title>
Delete Budget
</v-card-title>
<v-card-subtitle>
This deletes the whole bugdet including all transactions, assignments, accounts and categories. Not undoable!
</v-card-subtitle>
</v-card-header-text>
</v-card-header>
<v-card-actions class="justify-center">
<v-btn @click="deleteBudget" color="error">Delete budget</v-btn>
</v-card-actions>
</v-card>
</v-col>
<v-col cols="12" md="6" xl="3">
<v-card>
<v-card-header>