Skip to content

Commit

Permalink
Merge pull request #3 from bamboo-firewall/quannt86/dev
Browse files Browse the repository at this point in the history
Feature: Update user role to lowerCase
  • Loading branch information
bienkma authored Sep 21, 2023
2 parents 9d5000c + cf43ae2 commit 1c0b744
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/provider/AppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const AppProvider: React.FC<Props> = ({ children }) => {
const res: APIResponse<IContextValue['userInfo']> = await BambooService.getUserInfo();
if (res?.error) return null;
message.success(`Welcome back, ${res?.data?.name}`);
return res?.data;

const role = res?.data?.role ?? 'user';
return { ...res?.data, role: role.toLowerCase() as IUser['role'] };
},
{
staleTime: Infinity,
Expand Down

0 comments on commit 1c0b744

Please sign in to comment.