1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-21 18:21:36 +02:00
This commit is contained in:
Flam3rboy 2021-10-11 15:21:11 +02:00
parent 237137bd6e
commit 2af567b522

View File

@ -31,10 +31,10 @@ router.patch("/", route({ body: "ChannelReorderSchema", permission: "MANAGE_CHAN
await Promise.all([
body.map(async (x) => {
if (!x.position && !x.parent_id) throw new HTTPError(`You need to at least specify position or parent_id`, 400);
if (x.position == null && !x.parent_id) throw new HTTPError(`You need to at least specify position or parent_id`, 400);
const opts: any = {};
if (x.position) opts.position = x.position;
if (x.position != null) opts.position = x.position;
if (x.parent_id) {
opts.parent_id = x.parent_id;