We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c8a65d commit 0b5ede2Copy full SHA for 0b5ede2
server/apis/workspace/service.ts
@@ -27,8 +27,8 @@ export const join = async (userId: number, code: string) => {
27
28
const { id, name } = workspace;
29
30
- await workspaceModel.updateOne({ id }, { $push: { users: userId } });
31
- await userModel.updateOne({ id: userId }, { $push: { workspaces: id } });
+ await workspaceModel.updateOne({ id }, { $addToSet: { users: userId } });
+ await userModel.updateOne({ id: userId }, { $addToSet: { workspaces: id } });
32
33
return { id, name, code };
34
};
0 commit comments