summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-10-29 13:08:16 +0100
committerRory& <root@rory.gay>2026-10-29 13:08:31 +0100
commit09b71a1a5232c22716a727eb5cd7641107225ae0 (patch)
tree1d8b34e6b72fb759fe2e3e792c4955a4b48265e6 /src/api
parentSmall code formatting fix in client, log cloud upload request/response (diff)
downloadserver-ts-09b71a1a5232c22716a727eb5cd7641107225ae0.tar.xz
Fix guild patch with channel ids
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/guilds/#guild_id/index.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/api/routes/guilds/#guild_id/index.ts b/src/api/routes/guilds/#guild_id/index.ts

index a05bf4669..9fa61a4d3 100644 --- a/src/api/routes/guilds/#guild_id/index.ts +++ b/src/api/routes/guilds/#guild_id/index.ts
@@ -122,9 +122,6 @@ router.patch( guild.features = body.features; } - // TODO: check if body ids are valid - guild.assign(body); - if (body.public_updates_channel_id == "1") { // create an updates channel for them const channel = await Channel.createChannel( @@ -149,7 +146,7 @@ router.patch( await Guild.insertChannelInOrder(guild.id, channel.id, 0, guild); - guild.public_updates_channel_id = channel.id; + body.public_updates_channel_id = channel.id; } else if (body.public_updates_channel_id != undefined) { // ensure channel exists in this guild await Channel.findOneOrFail({ @@ -182,7 +179,7 @@ router.patch( await Guild.insertChannelInOrder(guild.id, channel.id, 0, guild); - guild.rules_channel_id = channel.id; + body.rules_channel_id = channel.id; } else if (body.rules_channel_id != undefined) { // ensure channel exists in this guild await Channel.findOneOrFail({ @@ -191,6 +188,8 @@ router.patch( }); } + guild.assign(body); + const data = guild.toJSON(); // TODO: guild hashes // TODO: fix vanity_url_code, template_id