diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index 22a0d3fc..417c0e85 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -663,9 +663,10 @@ const itemCard = [ ]; async function toggleStatusProduct(id: string, status: Status) { - await editProduct(id, { + const res = await editProduct(id, { status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE', }); + if (res) formDataProduct.value.status = res.status; await alternativeFetch(); flowStore.rotate(); @@ -726,11 +727,11 @@ async function triggerChangeStatus( await toggleStatusType(id, status as Status) .then(resolve) .catch(reject); - } else if (type === 'service' || productMode.value === 'service') { + } else if (type === 'service') { await toggleStatusService(id, status as Status) .then(resolve) .catch(reject); - } else if (type === 'product' || productMode.value === 'product') { + } else if (type === 'product') { await toggleStatusProduct(id, status as Status) .then(resolve) .catch(reject); @@ -3841,8 +3842,9 @@ watch( + @@ -4195,9 +4208,10 @@ watch( +