summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/users/groups/create.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-03-24 11:05:37 +0900
committerGitHub <noreply@github.com>2021-03-24 11:05:37 +0900
commitce340aba7a37394c70b9f3d7cece9cfa5e91d94c (patch)
tree99612ea0d039f20e0baa9ca243e8cec0af96b11a /src/server/api/endpoints/users/groups/create.ts
parentfix bug (diff)
downloadsharkey-ce340aba7a37394c70b9f3d7cece9cfa5e91d94c.tar.gz
sharkey-ce340aba7a37394c70b9f3d7cece9cfa5e91d94c.tar.bz2
sharkey-ce340aba7a37394c70b9f3d7cece9cfa5e91d94c.zip
Refactor (#7394)
* wip * wip * wip * wip * wip * Update define.ts * Update update.ts * Update user.ts * wip * wip * Update request.ts * URL * wip * wip * wip * wip * Update invite.ts * Update create.ts
Diffstat (limited to 'src/server/api/endpoints/users/groups/create.ts')
-rw-r--r--src/server/api/endpoints/users/groups/create.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/api/endpoints/users/groups/create.ts b/src/server/api/endpoints/users/groups/create.ts
index 2c397b9cd1..0966ef7819 100644
--- a/src/server/api/endpoints/users/groups/create.ts
+++ b/src/server/api/endpoints/users/groups/create.ts
@@ -31,12 +31,12 @@ export const meta = {
};
export default define(meta, async (ps, user) => {
- const userGroup = await UserGroups.save({
+ const userGroup = await UserGroups.insert({
id: genId(),
createdAt: new Date(),
userId: user.id,
name: ps.name,
- } as UserGroup);
+ } as UserGroup).then(x => UserGroups.findOneOrFail(x.identifiers[0]));
// Push the owner
await UserGroupJoinings.insert({