Skip to content

Commit

Permalink
Merge pull request #45059 from daledah/fix/44150
Browse files Browse the repository at this point in the history
fix: workspace admin aren't listed in 'Preferred exporter'
  • Loading branch information
jasperhuangg authored Jul 15, 2024
2 parents ed658ed + 7144cd3 commit 73ddc4f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,12 @@ function getPersonalPolicy() {
}

function getAdminEmployees(policy: OnyxEntry<Policy>): PolicyEmployee[] {
return Object.values(policy?.employeeList ?? {}).filter((employee) => employee.role === CONST.POLICY.ROLE.ADMIN);
if (!policy || !policy.employeeList) {
return [];
}
return Object.keys(policy.employeeList)
.map((email) => ({...policy.employeeList?.[email], email}))
.filter((employee) => employee.role === CONST.POLICY.ROLE.ADMIN);
}

/**
Expand Down

0 comments on commit 73ddc4f

Please sign in to comment.