fix: check profiles and orgId from user.profiles apiv2 (#16249)

* fix: check profiles and orgId from user.profiles apiv2

* fixup! fix: check profiles and orgId from user.profiles apiv2

---------

Co-authored-by: Lauris Skraucis <[email protected]>
This commit is contained in:
MorganandLauris Skraucis authored and GitHub committed 2024-08-21 15:15:48 +00:00
1 parent 7759e6a029
commit 1690770d6a
11 files changed
+49 -23

No files matched your search

@@ -30,6 +30,10 @@ export class UsersService {
);
}
getUserMainOrgId(user: UserWithProfile) {
return this.getUserMainProfile(user)?.organizationId ?? user.organizationId;
}
getUserProfileByOrgId(user: UserWithProfile, organizationId: number) {
return user.profiles?.find((p) => p.organizationId === organizationId);
}