Skip to content

Commit

Permalink
chore(app): manage access users update
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Dec 1, 2024
1 parent 31789e6 commit f91cdd3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/states/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,9 @@ export const congregationsAppAdminState = selector({
get: ({ get }) => {
const users = get(congregationUsersState);

return users.filter((record) => record.profile.cong_role.includes('admin'));
return users.filter((record) =>
record.profile.cong_role?.includes('admin')
);
},
});

Expand All @@ -554,8 +556,8 @@ export const congregationsBaptizedPersonsState = selector({
return users.filter(
(record) =>
record.profile.global_role === 'vip' &&
!record.profile.cong_role.includes('admin') &&
!record.profile.cong_role.includes('coordinator')
!record.profile.cong_role?.includes('admin') &&
!record.profile.cong_role?.includes('coordinator')
);
},
});
Expand Down

0 comments on commit f91cdd3

Please sign in to comment.