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:
parent
df0db20acd
commit
6b7de26f1c
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user