Skip to content

Commit

Permalink
Update set user role to lowerCase
Browse files Browse the repository at this point in the history
  • Loading branch information
quannt86 committed Sep 21, 2023
1 parent bb44dd6 commit cf43ae2
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 cf43ae2

Please sign in to comment.