refactor(api): enforce layered architecture by moving db queries to core services

This commit is contained in:
yiling
2026-08-01 16:25:01 +08:00
parent fb66166b49
commit 97069042b2
26 changed files with 256 additions and 363 deletions
+10
View File
@@ -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 {