use team redis keys to resolve team gated features
This commit is contained in:
1 parent
0a4dcebed7
commit
cd2b303e89
7 files changed
+58
-13
No files matched your search
@@ -100,6 +100,13 @@ export async function getAllUserTeams(userId: string) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function getTeamOwner(teamId: string) {
|
||||
return prisma.client.teamUser.findFirst({
|
||||
where: { teamId, role: ROLES.teamOwner },
|
||||
select: { userId: true },
|
||||
});
|
||||
}
|
||||
|
||||
export async function createTeam(data: Prisma.TeamCreateInput, userId: string): Promise<any> {
|
||||
const { id } = data;
|
||||
const { client, transaction } = prisma;
|
||||
|
||||
Reference in new issue
Block a user