diff options
Diffstat (limited to 'api/src/routes/channels/#channel_id/recipients.ts')
-rw-r--r-- | api/src/routes/channels/#channel_id/recipients.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/api/src/routes/channels/#channel_id/recipients.ts b/api/src/routes/channels/#channel_id/recipients.ts index d6e25599..069212e2 100644 --- a/api/src/routes/channels/#channel_id/recipients.ts +++ b/api/src/routes/channels/#channel_id/recipients.ts @@ -11,6 +11,7 @@ import { User } from "@fosscord/util"; import { route } from "@fosscord/api"; +import { OrmUtils } from "@fosscord/util"; const router: Router = Router(); @@ -28,7 +29,7 @@ router.put("/:user_id", route({}), async (req: Request, res: Response) => { throw DiscordApiErrors.INVALID_RECIPIENT; //TODO is this the right error? } - channel.recipients!.push(Object.assign(new Recipient(), { channel_id, user_id: user_id })); + channel.recipients!.push(OrmUtils.mergeDeep(new Recipient(), { channel_id, user_id: user_id })); await channel.save(); await emitEvent({ |