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 22:49:16 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-09 23:28:27 +0200
commit26293f37a1f7af131507c0bdd490d2e07f1a9ba7 (patch)
tree3fdaa7b65f1b66069d08d06143a43c9908395a09 /api/src/routes/guilds/templates
parentClean up BaseClient assign call (diff)
downloadserver-ts-26293f37a1f7af131507c0bdd490d2e07f1a9ba7.tar.xz
Use deep merge everywhere
Diffstat (limited to 'api/src/routes/guilds/templates')
-rw-r--r--api/src/routes/guilds/templates/index.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/api/src/routes/guilds/templates/index.ts b/api/src/routes/guilds/templates/index.ts

index bb8cc017..bac4eb8a 100644 --- a/api/src/routes/guilds/templates/index.ts +++ b/api/src/routes/guilds/templates/index.ts
@@ -4,6 +4,7 @@ import { route } from "@fosscord/api"; import { DiscordApiErrors } from "@fosscord/util"; import fetch from "node-fetch"; const router: Router = Router(); +import { OrmUtils } from "@fosscord/util"; export interface GuildTemplateCreateSchema { name: string; @@ -57,13 +58,13 @@ router.post("/:code", route({ body: "GuildTemplateCreateSchema" }), async (req: const guild_id = Snowflake.generate(); const [guild, role] = await Promise.all([ - Object.assign(new Guild(), { + OrmUtils.mergeDeep(new Guild(), { ...body, ...template.serialized_source_guild, id: guild_id, owner_id: req.user_id }).save(), - (Object.assign(new Role(), { + (OrmUtils.mergeDeep(new Role(), { id: guild_id, guild_id: guild_id, color: 0,