Account itself deletable
This commit is contained in:
@@ -20,4 +20,8 @@ export async function registerAccount(account: AccountModel) {
|
||||
|
||||
export async function updateAccount(account: AccountModel) {
|
||||
return await axios.patch(BASE_URL, account)
|
||||
}
|
||||
|
||||
export async function deleteAccount(account: AccountModel) {
|
||||
return await axios.delete(BASE_URL + "/" + account.id)
|
||||
}
|
||||
@@ -43,6 +43,6 @@ const accountStore = useAccountStore()
|
||||
v-model="showConfirmDialog"
|
||||
:title="$t('account.deleteAccount.dialog.title')"
|
||||
:description="$t('account.deleteAccount.dialog.description')"
|
||||
:on-confirm="() => accountStore.deleteAccount(accountStore.userAccount)"
|
||||
/>
|
||||
<!-- todo :onConfirm="deleteAccount" -->
|
||||
</template>
|
||||
@@ -60,6 +60,7 @@ async function startLogin() {
|
||||
append-icon="mdi-arrow-right"
|
||||
@click="startLogin"
|
||||
:loading="accountStore.fetchInProgress"
|
||||
color="green"
|
||||
>
|
||||
{{ $t('account.login.login') }}
|
||||
</outlined-button>
|
||||
|
||||
@@ -38,12 +38,7 @@ concertStore.getConcert(Number(router.currentRoute.value.params.id))
|
||||
:link="false"
|
||||
:title="concertStore.concert.location.city.name"
|
||||
:show-button="false"
|
||||
>
|
||||
<template #description>
|
||||
<p>{{ concertStore.concert.location.name }}</p>
|
||||
<!-- todo <p>{{ concertModel.event.band.name }} - {{ concertModel.event.name }}</p> -->
|
||||
</template>
|
||||
</concert-list-item>
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user