feat: deleteService

This commit is contained in:
Net 2024-06-18 16:14:50 +07:00
parent 45c58d6085
commit 2ffc252a8b

View file

@ -53,6 +53,7 @@ const {
fetchListService,
fetchListServiceById,
createService,
deleteService,
} = productServiceStore;
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) {
dialog({
color: 'negative',