Made it so it will show always the corporate

This commit is contained in:
Tiago Ribeiro
2024-09-05 19:55:19 +01:00
parent 311824e8b7
commit 680f4cfa95

View File

@@ -40,7 +40,7 @@ export const getUserCorporate = async (id: string) => {
const groups = await getParticipantGroups(id); const groups = await getParticipantGroups(id);
const admins = await Promise.all(groups.map((x) => x.admin).map(getUser)); const admins = await Promise.all(groups.map((x) => x.admin).map(getUser));
const corporates = admins.filter((x) => x.type === "corporate" || x.type === "mastercorporate"); const corporates = admins.filter((x) => (user.type === "corporate" ? x.type === "mastercorporate" : x.type === "corporate"));
if (corporates.length === 0) return undefined; if (corporates.length === 0) return undefined;
return corporates.shift() as CorporateUser | MasterCorporateUser; return corporates.shift() as CorporateUser | MasterCorporateUser;