mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
feat(server): cleanup legacy compatibility (#15239)
This commit is contained in:
@@ -88,12 +88,14 @@ export async function addUserToWorkspace(
|
||||
if (workspace == null) {
|
||||
throw new Error(`workspace ${workspaceId} not found`);
|
||||
}
|
||||
await client.workspaceUserRole.create({
|
||||
await client.workspaceMember.create({
|
||||
data: {
|
||||
workspaceId: workspace.id,
|
||||
userId,
|
||||
status: 'Accepted',
|
||||
type: permission,
|
||||
role:
|
||||
permission === 99 ? 'owner' : permission === 10 ? 'admin' : 'member',
|
||||
state: 'active',
|
||||
source: 'legacy',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user