Skip to content

Commit

Permalink
updated shouldShowEmployeeListError
Browse files Browse the repository at this point in the history
  • Loading branch information
FitseTLT committed Nov 22, 2024
1 parent 128de7f commit 631f908
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const isPolicyAdmin = (policy: OnyxInputOrEntry<Policy> | SearchPolicy, currentU
* Checks if we have any errors stored within the policy?.employeeList. Determines whether we should show a red brick road error or not.
*/
function shouldShowEmployeeListError(policy: OnyxEntry<Policy>): boolean {
return Object.values(policy?.employeeList ?? {}).some((employee) => Object.keys(employee?.errors ?? {}).length > 0);
return isPolicyAdmin(policy) && Object.values(policy?.employeeList ?? {}).some((employee) => Object.keys(employee?.errors ?? {}).length > 0);
}

/**
Expand Down

0 comments on commit 631f908

Please sign in to comment.