diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-08-08 22:49:16 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-08-09 23:28:27 +0200 |
commit | 26293f37a1f7af131507c0bdd490d2e07f1a9ba7 (patch) | |
tree | 3fdaa7b65f1b66069d08d06143a43c9908395a09 /util/src/entities/User.ts | |
parent | Clean up BaseClient assign call (diff) | |
download | server-26293f37a1f7af131507c0bdd490d2e07f1a9ba7.tar.xz |
Use deep merge everywhere
Diffstat (limited to 'util/src/entities/User.ts')
-rw-r--r-- | util/src/entities/User.ts | 5 |
1 files changed, 3 insertions, 2 deletions
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, |