mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-30 21:04:59 +00:00
refactor(api): enforce layered architecture by moving db queries to core services
This commit is contained in:
@@ -364,6 +364,16 @@ export class TeamService {
|
||||
}
|
||||
}
|
||||
|
||||
async hasWritableRoleInAnyTeam(userId: string): Promise<boolean> {
|
||||
const member = await prisma.teamMember.findFirst({
|
||||
where: {
|
||||
userId,
|
||||
role: { in: ['owner', 'editor'] },
|
||||
},
|
||||
})
|
||||
return !!member
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private toTeamInfo(team: any): TeamInfo {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user