diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 2d2f1f44..a6099b5d 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -27,6 +27,8 @@ import CustomerInfoComponent from 'src/components/03_customer-management/Custome import { CustomerCreate, CustomerStats, Customer } from 'stores/customer/types'; import { onMounted } from 'vue'; +import { dialog } from 'src/stores/utils'; + const userCustomer = useCustomerStore(); const { create, getStatsCustomer, fetchList } = userCustomer; const formData = ref({ @@ -352,6 +354,24 @@ onMounted(async () => { } " @view-card="openDialogInputForm" + @delete-card=" + dialog({ + color: 'negative', + icon: 'mdi-alert', + title: $t('deleteConfirmTitle'), + actionText: $t('ok'), + persistent: true, + message: $t('deleteConfirmMessage'), + action: async () => { + await userCustomer.deleteById(i.id); + + const resultList = await fetchList(); + + if (resultList) listCustomer = resultList; + }, + cancel: () => {}, + }) + " />