fix: แก้ไขสินค้า และ บริการ ไม่อัปเดต

This commit is contained in:
Net 2024-06-26 14:21:14 +07:00
parent 0bc0c2efa9
commit 018edf688b

View file

@ -763,24 +763,26 @@ async function submitService() {
formDataProductService.value.productTypeId = currentIdType.value;
if (dialogService.value) {
const res = await createService(formDataProductService.value);
if (res) {
await fetchListOfService();
}
await createService(formDataProductService.value);
totalService.value = totalService.value + 1;
}
if (dialogServiceEdit.value) {
const res = await editService(currentIdService.value, {
await editService(currentIdService.value, {
...formDataProductService.value,
status: statusToggle.value
? formDataProductService.value.status
: 'INACTIVE',
});
if (res) {
await fetchListOfService();
}
}
totalService.value = totalService.value + 1;
if (productAndServiceTab.value === 'all') {
await fetchListOfProductAndService();
}
if (productAndServiceTab.value === 'service') {
await fetchListOfService();
}
clearFormService();
}
@ -806,7 +808,13 @@ async function submitProduct() {
}
totalProduct.value = totalProduct.value + 1;
clearFormProduct();
await fetchListOfProduct(currentIdType.value);
if (productAndServiceTab.value === 'all') {
await fetchListOfProductAndService();
}
if (productAndServiceTab.value === 'product') {
await fetchListOfProduct(currentIdType.value);
}
}
async function submitGroup() {
@ -1003,7 +1011,7 @@ watch(currentPageService, async () => {
:label="$t('addService')"
external-label
label-position="left"
style="color: white; background-color: hsla(var(--blue-11-hsl))"
style="color: white; background-color: hsla(var(--orange-6-hsl))"
padding="xs"
icon="mdi-folder-multiple-plus"
@click="