From a8598dfb5e4536663853717398e7f149eb0e3ca0 Mon Sep 17 00:00:00 2001 From: Ridwa Date: Tue, 16 Jul 2024 11:06:05 +0530 Subject: [PATCH] Improved: Optimized code , removed unnecessary check (#285) --- src/store/modules/facility/actions.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/store/modules/facility/actions.ts b/src/store/modules/facility/actions.ts index 42ff8f08..e4786be2 100644 --- a/src/store/modules/facility/actions.ts +++ b/src/store/modules/facility/actions.ts @@ -713,14 +713,12 @@ const actions: ActionTree = { const resp = await FacilityService.fetchFacilityGroups(params) - if (!hasError(resp)) { - if(resp.data.count > 0){ + if (!hasError(resp) && resp.data.count > 0) { if (payload.viewIndex && payload.viewIndex > 0) { groups = groups.concat(resp.data.docs) } else { groups = resp.data.docs } - } total = resp.data.count } else { throw resp.data