Skip to content

Commit

Permalink
Improved: Optimized code , removed unnecessary check (hotwax#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridwan6947 committed Jul 16, 2024
1 parent dce3d91 commit a8598df
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/store/modules/facility/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,14 +713,12 @@ const actions: ActionTree<FacilityState, RootState> = {

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
Expand Down

0 comments on commit a8598df

Please sign in to comment.