From d52d9c62fc30e31e2c01bf6b63f9aedebdde216f Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 8 Aug 2022 04:27:28 +0200 Subject: Bunch of fixes and improvements, everything appears to work now --- api/src/routes/guilds/templates/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'api/src/routes/guilds/templates') diff --git a/api/src/routes/guilds/templates/index.ts b/api/src/routes/guilds/templates/index.ts index e2242ebf..bb8cc017 100644 --- a/api/src/routes/guilds/templates/index.ts +++ b/api/src/routes/guilds/templates/index.ts @@ -57,13 +57,13 @@ router.post("/:code", route({ body: "GuildTemplateCreateSchema" }), async (req: const guild_id = Snowflake.generate(); const [guild, role] = await Promise.all([ - new Guild({ + Object.assign(new Guild(), { ...body, ...template.serialized_source_guild, id: guild_id, owner_id: req.user_id }).save(), - new Role({ + (Object.assign(new Role(), { id: guild_id, guild_id: guild_id, color: 0, @@ -74,7 +74,7 @@ router.post("/:code", route({ body: "GuildTemplateCreateSchema" }), async (req: permissions: BigInt("2251804225"), position: 0, tags: null - }).save() + }) as Role).save() ]); await Member.addToGuild(req.user_id, guild_id); -- cgit 1.5.1