fix: แก้ เปลี่ยนสถานะเเล้วไม่ อัพเดท

This commit is contained in:
Net 2024-07-08 16:52:00 +07:00
parent 26d6c58390
commit f3b0dc4e1d

View file

@ -469,7 +469,7 @@ async function toggleStatusProduct(id: string, status: Status) {
status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE', status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE',
}); });
await fetchListOfProduct(); await alternativeFetch();
flowStore.rotate(); flowStore.rotate();
} }
@ -478,7 +478,7 @@ async function toggleStatusService(id: string, status: Status) {
status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE', status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE',
}); });
await fetchListOfService(); await alternativeFetch();
flowStore.rotate(); flowStore.rotate();
} }
async function toggleStatusType(id: string, status: Status) { async function toggleStatusType(id: string, status: Status) {
@ -973,6 +973,11 @@ async function fetchStatus() {
} }
async function alternativeFetch() { async function alternativeFetch() {
console.log('asdasds');
if (productAndServiceTab.value === 'all') { if (productAndServiceTab.value === 'all') {
await fetchListOfProductAndService(); await fetchListOfProductAndService();
flowStore.rotate(); flowStore.rotate();