summary refs log tree commit diff
path: root/api/src/routes/channels/#channel_id/index.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-18 11:47:28 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-18 11:47:28 +0200
commit4105df8dcb825dd3d0ca048ca2bb09f9ada3d390 (patch)
treedff83a75ad8cb2fef29aac520005bf2c2accf9f2 /api/src/routes/channels/#channel_id/index.ts
parentfix #199 (diff)
downloadserver-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.ts2
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);