From 26293f37a1f7af131507c0bdd490d2e07f1a9ba7 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 8 Aug 2022 22:49:16 +0200 Subject: Use deep merge everywhere --- util/src/entities/User.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util/src/entities/User.ts') diff --git a/util/src/entities/User.ts b/util/src/entities/User.ts index 81017c2d..d023780b 100644 --- a/util/src/entities/User.ts +++ b/util/src/entities/User.ts @@ -1,4 +1,5 @@ -import { Column, Entity, FindOneOptions, FindOptionsSelectByString, JoinColumn, ManyToMany, OneToMany, RelationId } from "typeorm"; +import { Column, Entity, FindOneOptions, FindOptionsSelectByString, JoinColumn, ManyToMany, OneToMany, RelationId} from "typeorm"; +import { OrmUtils } from "@fosscord/util"; import { BaseClass } from "./BaseClass"; import { BitField } from "../util/BitField"; import { Relationship } from "./Relationship"; @@ -255,7 +256,7 @@ export class User extends BaseClass { // if nsfw_allowed is null/undefined it'll require date_of_birth to set it to true/false const language = req.language === "en" ? "en-US" : req.language || "en-US"; - const user = Object.assign(new User(), { + const user = OrmUtils.mergeDeep(new User(), { created_at: new Date(), username: username, discriminator, -- cgit 1.4.1