TP-62561 | API driven teamlead role (#813)

This commit is contained in:
Mantri Ramkishor
2024-06-03 18:52:58 +05:30
committed by GitHub

View File

@@ -137,14 +137,9 @@ export const userSlice = createSlice({
state.agentAttendance = action.payload;
},
setUserAccessData: (state, action) => {
const {roles, isExternalAgent, featureFlags} = action.payload || {};
const {roles, isExternalAgent, isFieldTeamLeadOrAgencyManager, featureFlags} = action.payload || {};
if (roles?.length) {
state.isTeamLead = roles.some((role: IUserRole) =>
[
IUserRole.ROLE_NAVI_FIELD_TEAM_LEAD,
IUserRole.ROLE_NAVI_FIELD_EXTERNAL_TEAM_LEAD,
].includes(role)
);
state.isTeamLead = isFieldTeamLeadOrAgencyManager;
} else {
state.isTeamLead = false;
}