summary refs log tree commit diff
path: root/src/routes/guilds/templates/index.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/routes/guilds/templates/index.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/routes/guilds/templates/index.ts b/src/routes/guilds/templates/index.ts

index 2d8cdf0e..7e32e94c 100644 --- a/src/routes/guilds/templates/index.ts +++ b/src/routes/guilds/templates/index.ts
@@ -40,7 +40,7 @@ router.post("/:code", check(GuildTemplateCreateSchema), async (req: Request, res owner_id: req.user_id, }; - await Promise.all([ + const [guild_doc, role] = await Promise.all([ new GuildModel(guild).save(), new RoleModel({ id: guild_id, @@ -55,7 +55,8 @@ router.post("/:code", check(GuildTemplateCreateSchema), async (req: Request, res tags: null, }).save(), ]); - await addMember(req.user_id, guild_id, { guild }); + + await addMember(req.user_id, guild_id, { guild: guild_doc }); res.status(201).json({ id: guild.id }); });