fix: platform org members cannot access their public booking page (#20821)
* fix: platform member event pages * chore: update slots docs * refactor: user repository call * refactor: remove newline
This commit is contained in:
1 parent
f5217caef2
commit
f31c45a153
7 files changed
+60
-13
No files matched your search
@@ -373,9 +373,11 @@ export const getPublicEvent = async (
|
||||
some: {
|
||||
username,
|
||||
isPlatformManaged: false,
|
||||
movedToProfile: {
|
||||
organization: {
|
||||
isPlatform: true,
|
||||
profiles: {
|
||||
some: {
|
||||
organization: {
|
||||
isPlatform: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -161,6 +161,32 @@ export class UserRepository {
|
||||
});
|
||||
}
|
||||
|
||||
static async findPlatformMembersByUsernames({ usernameList }: { usernameList: string[] }) {
|
||||
return (
|
||||
await prisma.user.findMany({
|
||||
select: userSelect,
|
||||
where: {
|
||||
username: {
|
||||
in: usernameList,
|
||||
},
|
||||
isPlatformManaged: false,
|
||||
profiles: {
|
||||
some: {
|
||||
organization: {
|
||||
isPlatform: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
).map((user) => {
|
||||
return {
|
||||
...user,
|
||||
profile: ProfileRepository.buildPersonalProfileFromUser({ user }),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
static async _getWhereClauseForFindingUsersByUsername({
|
||||
orgSlug,
|
||||
usernameList,
|
||||
|
||||
Reference in new issue
Block a user