summary refs log tree commit diff
path: root/api/src/routes/guilds/templates
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-08 04:27:28 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-09 23:28:27 +0200
commitd52d9c62fc30e31e2c01bf6b63f9aedebdde216f (patch)
treee0f7fd130aeeecb9964e1f359eea6b4e124de7da /api/src/routes/guilds/templates
parentClean dependencies (diff)
downloadserver-ts-d52d9c62fc30e31e2c01bf6b63f9aedebdde216f.tar.xz
Bunch of fixes and improvements, everything appears to work now
Diffstat (limited to 'api/src/routes/guilds/templates')
-rw-r--r--api/src/routes/guilds/templates/index.ts6
1 files changed, 3 insertions, 3 deletions
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);