summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2026-02-07 00:08:19 -0600
committerRory& <root@rory.gay>2026-02-08 08:44:27 +0100
commit22e580a063f187b4a4fad02e4cd10f86bf89feb1 (patch)
tree87648dc859a78d2394aa125b22b19508336046d0 /src/api
parentallow tag modification (diff)
downloadserver-ts-22e580a063f187b4a4fad02e4cd10f86bf89feb1.tar.xz
correct tag change check
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/channels/#channel_id/index.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/routes/channels/#channel_id/index.ts b/src/api/routes/channels/#channel_id/index.ts

index 4da3cf09..04f53e91 100644 --- a/src/api/routes/channels/#channel_id/index.ts +++ b/src/api/routes/channels/#channel_id/index.ts
@@ -187,7 +187,8 @@ router.patch( const bad = payload.applied_tags.find((tag) => !realTags.has(tag)); //TODO better error if (bad) throw new Error("Invalid tag " + bad); - const permsNeeded = payload.applied_tags.find((_) => realTags.get(_)?.moderated); + const changed = new Set(channel.applied_tags || []).symmetricDifference(new Set(payload.applied_tags)); + const permsNeeded = [...changed].find((_) => realTags.get(_)?.moderated); if (permsNeeded) { req.permission?.hasThrow("MANAGE_THREADS"); }