feat: deleteService
This commit is contained in:
parent
45c58d6085
commit
2ffc252a8b
1 changed files with 18 additions and 0 deletions
|
|
@ -53,6 +53,7 @@ const {
|
||||||
fetchListService,
|
fetchListService,
|
||||||
fetchListServiceById,
|
fetchListServiceById,
|
||||||
createService,
|
createService,
|
||||||
|
deleteService,
|
||||||
} = productServiceStore;
|
} = productServiceStore;
|
||||||
|
|
||||||
import ItemCard from 'src/components/ItemCard.vue';
|
import ItemCard from 'src/components/ItemCard.vue';
|
||||||
|
|
@ -274,6 +275,23 @@ const itemCard = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
async function deleteServiceById(serviceId?: string) {
|
||||||
|
dialog({
|
||||||
|
color: 'negative',
|
||||||
|
icon: 'mdi-alert',
|
||||||
|
title: t('deleteConfirmTitle'),
|
||||||
|
actionText: t('ok'),
|
||||||
|
persistent: true,
|
||||||
|
message: t('deleteConfirmMessage'),
|
||||||
|
action: async () => {
|
||||||
|
await deleteService(serviceId ?? currentIdService.value);
|
||||||
|
|
||||||
|
await fetchListOfService();
|
||||||
|
},
|
||||||
|
cancel: () => {},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function deleteProductById(productId?: string) {
|
async function deleteProductById(productId?: string) {
|
||||||
dialog({
|
dialog({
|
||||||
color: 'negative',
|
color: 'negative',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue