Account itself deletable

This commit is contained in:
2024-11-04 19:05:14 +01:00
parent ffccd9f2d4
commit c3d0cc2879
6 changed files with 27 additions and 11 deletions

View File

@@ -1,9 +1,9 @@
import { useLocalStorage } from "@vueuse/core";
import { defineStore } from "pinia";
import { acceptHMRUpdate, defineStore } from "pinia";
import { AccountModel } from "../data/models/user/accountModel";
import { OrderModel } from "../data/models/ordering/orderModel";
import { useFeedbackStore } from "./feedback.store";
import { fetchAllAccounts, loginAccount, registerAccount, updateAccount } from "../data/api/accountApi";
import { deleteAccount, fetchAllAccounts, loginAccount, registerAccount, updateAccount } from "../data/api/accountApi";
import { fetchUserOrders } from "../data/api/orderApi";
import { BannerStateEnum } from "../data/enums/bannerStateEnum";
import { AddressModel } from "../data/models/user/addressModel";
@@ -191,8 +191,13 @@ export const useAccountStore = defineStore("accountStore", {
// todo
},
async deleteAccount(item: AccountModel) {
// todo
async deleteAccount(account: AccountModel) {
this.fetchInProgress = true
deleteAccount(account)
.then(response => {
this.fetchInProgress = false
})
}
}
})