summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-11 19:44:09 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-11 19:44:09 +0200
commit6b7de26f1cdfe76133f07987e36917c3db07f3ec (patch)
treea9d7b8b5f719e258f317b27bcf7e84355329c481
parentnpm i @fosscord/server-util@1.3.48 (diff)
downloadserver-6b7de26f1cdfe76133f07987e36917c3db07f3ec.tar.xz
:construction: fix guild channel position
-rw-r--r--src/routes/guilds/#guild_id/channels.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/routes/guilds/#guild_id/channels.ts b/src/routes/guilds/#guild_id/channels.ts

index f9a48999..52361f5e 100644 --- a/src/routes/guilds/#guild_id/channels.ts +++ b/src/routes/guilds/#guild_id/channels.ts
@@ -40,7 +40,7 @@ router.post("/", check(ChannelModifySchema), async (req: Request, res: Response) // TODO: check if parent_id exists router.patch( "/", - check({ id: String, $position: Number, $lock_permissions: Boolean, $parent_id: String }), + check([{ id: String, $position: Number, $lock_permissions: Boolean, $parent_id: String }]), async (req: Request, res: Response) => { // changes guild channel position const { guild_id } = req.params; @@ -64,7 +64,7 @@ router.patch( const channel = await ChannelModel.findOneAndUpdate({ id: req.body, guild_id }, opts).exec(); - await emitEvent({ event: "CHANNEL_UPDATE", data: channel, channel_id: body.id } as ChannelUpdateEvent); + await emitEvent({ event: "CHANNEL_UPDATE", data: channel, channel_id: body.id, guild_id } as ChannelUpdateEvent); res.json(toObject(channel)); }