1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 02:12:40 +01:00
This commit is contained in:
Madeline 2023-08-12 00:42:14 +10:00
parent c0614b18c3
commit 3eb2338c3e
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -157,6 +157,9 @@ router.patch(
guild.features = body.features;
}
// TODO: check if body ids are valid
guild.assign(body);
if (body.public_updates_channel_id == "1") {
// move all channels up 1
await Channel.createQueryBuilder("channels")
@ -185,7 +188,7 @@ router.patch(
{ skipPermissionCheck: true },
);
guild.rules_channel_id = channel.id;
guild.public_updates_channel_id = channel.id;
} else if (body.public_updates_channel_id != undefined) {
// ensure channel exists in this guild
await Channel.findOneOrFail({
@ -231,9 +234,6 @@ router.patch(
});
}
// TODO: check if body ids are valid
guild.assign(body);
const data = guild.toJSON();
// TODO: guild hashes
// TODO: fix vanity_url_code, template_id