mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 03:56:23 +08:00
chore: drop old client support (#14369)
This commit is contained in:
@@ -302,6 +302,29 @@ export class WorkspaceUserModel extends BaseModel {
|
||||
});
|
||||
}
|
||||
|
||||
async hasSharedWorkspace(userId: string, otherUserId: string) {
|
||||
if (userId === otherUserId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const shared = await this.db.workspaceUserRole.findFirst({
|
||||
select: { id: true },
|
||||
where: {
|
||||
userId,
|
||||
status: WorkspaceMemberStatus.Accepted,
|
||||
workspace: {
|
||||
permissions: {
|
||||
some: {
|
||||
userId: otherUserId,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return !!shared;
|
||||
}
|
||||
|
||||
async paginate(workspaceId: string, pagination: PaginationInput) {
|
||||
return await Promise.all([
|
||||
this.db.workspaceUserRole.findMany({
|
||||
|
||||
Reference in New Issue
Block a user