diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index ae66ade6..c05a956f 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -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="