Skip to content

Commit

Permalink
Fix to org returns
Browse files Browse the repository at this point in the history
  • Loading branch information
Alec-Watson committed Jul 26, 2024
1 parent 5c854c3 commit 3772837
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion CoVAR-app/src/functions/requests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,19 @@ export const fetchUsersByOrg = async (orgId: string, accessToken: string) => {
data: { org_id: orgId },
headers: { Authorization: `Bearer ${accessToken}` },
};
return await handleRequest(request);

try {
const response = await handleRequest(request);
return response.map((user: any) => ({
id: user.user_id,
email: user.username,
role: user.role,
createdAt: user.createdAt,
}));
} catch (error) {
console.error('Error fetching users:', error);
throw error;
}
};

export const removeUser = async (orgId: string, ownerId: string, email: string, accessToken: string) => {
Expand Down

0 comments on commit 3772837

Please sign in to comment.