use team redis keys to resolve team gated features

This commit is contained in:
Francis Cao committed 2026-03-21 11:21:07 -07:00
1 parent 0a4dcebed7
commit cd2b303e89
7 files changed
+58 -13

No files matched your search

+7
View File
@@ -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;