summary refs log tree commit diff
path: root/api/src/routes/guilds/templates/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/routes/guilds/templates/index.ts')
-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,