feat: new workspace apis (#2825)

This commit is contained in:
DarkSky
2023-06-26 22:12:58 +08:00
committed by GitHub
parent e3ffd04804
commit d46b6c4863
7 changed files with 341 additions and 0 deletions

View File

@@ -117,6 +117,21 @@ export class PermissionService {
});
}
async accept(ws: string, user: string) {
const result = await this.prisma.userWorkspacePermission.updateMany({
where: {
workspaceId: ws,
userId: user,
accepted: false,
},
data: {
accepted: true,
},
});
return result.count > 0;
}
async revoke(ws: string, user: string) {
const result = await this.prisma.userWorkspacePermission.deleteMany({
where: {