1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

🚧 fix guild channel position

This commit is contained in:
Flam3rboy 2021-08-11 19:44:09 +02:00
parent df0db20acd
commit 6b7de26f1c

View File

@ -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));
}