Do not use a store for API

This commit is contained in:
2022-02-14 08:11:42 +00:00
parent ca93e9cd55
commit d11c0036b5
8 changed files with 43 additions and 56 deletions

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { defineComponent } from "vue"
import { useAPI } from "../stores/api";
import { DELETE, POST } from "../api";
import { useBudgetsStore } from "../stores/budget";
import { useSessionStore } from "../stores/session";
@ -35,8 +35,7 @@ export default defineComponent({
if (currentBudgetID == null)
return;
const api = useAPI();
api.DELETE("/budget/" + currentBudgetID);
DELETE("/budget/" + currentBudgetID);
const budgetStore = useSessionStore();
budgetStore.Budgets.delete(currentBudgetID);
@ -44,8 +43,7 @@ export default defineComponent({
},
clearBudget() {
const currentBudgetID = useBudgetsStore().CurrentBudgetID;
const api = useAPI();
api.POST("/budget/" + currentBudgetID + "/settings/clear", null)
POST("/budget/" + currentBudgetID + "/settings/clear", null)
},
cleanNegative() {
// <a href="/budget/{{.Budget.ID}}/settings/clean-negative">Fix all historic negative category-balances</a>