diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-18 11:47:28 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-18 11:47:28 +0200 |
commit | 4105df8dcb825dd3d0ca048ca2bb09f9ada3d390 (patch) | |
tree | dff83a75ad8cb2fef29aac520005bf2c2accf9f2 /api/src/routes/channels/#channel_id/index.ts | |
parent | fix #199 (diff) | |
download | server-4105df8dcb825dd3d0ca048ca2bb09f9ada3d390.tar.xz |
:bug: fix findOneAndUpdate
Diffstat (limited to 'api/src/routes/channels/#channel_id/index.ts')
-rw-r--r-- | api/src/routes/channels/#channel_id/index.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/routes/channels/#channel_id/index.ts b/api/src/routes/channels/#channel_id/index.ts index 3bfa80be..fb6bcb1a 100644 --- a/api/src/routes/channels/#channel_id/index.ts +++ b/api/src/routes/channels/#channel_id/index.ts @@ -43,7 +43,7 @@ router.patch("/", check(ChannelModifySchema), async (req: Request, res: Response const permission = await getPermission(req.user_id, undefined, channel_id); permission.hasThrow("MANAGE_CHANNELS"); - const channel = await ChannelModel.findOneAndUpdate({ id: channel_id }, payload).exec(); + const channel = await ChannelModel.findOneAndUpdate({ id: channel_id }, payload, { new: true }).exec(); const data = toObject(channel); |