fix: first time status change not working

This commit is contained in:
Methapon Metanipat 2024-08-16 09:39:30 +07:00
parent 60b0f3cd5f
commit 70f19c2082

View file

@ -386,11 +386,11 @@ async function triggerChangeStatus(id: string, status: string) {
: t('confirmChangeStatusOnMessage'),
action: async () => {
if (currentTab.value === 'employee') {
await toggleStatusEmployee(id, status === 'ACTIVE' ? true : false)
await toggleStatusEmployee(id, status === 'INACTIVE' ? false : true)
.then(resolve)
.catch(reject);
} else {
await toggleStatusCustomer(id, status === 'ACTIVE' ? true : false)
await toggleStatusCustomer(id, status === 'INACTIVE' ? false : true)
.then(resolve)
.catch(reject);
}