From 174e5cc23b8b3ac684f12c437ffaf88616774ac1 Mon Sep 17 00:00:00 2001 From: Lily Bergonzat Date: Tue, 20 Feb 2024 14:23:43 +0100 Subject: [PATCH] Fixed mute command not updating case when no reason --- backend/src/plugins/Mutes/functions/muteUser.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/plugins/Mutes/functions/muteUser.ts b/backend/src/plugins/Mutes/functions/muteUser.ts index ba2fe387..c61766c1 100644 --- a/backend/src/plugins/Mutes/functions/muteUser.ts +++ b/backend/src/plugins/Mutes/functions/muteUser.ts @@ -246,10 +246,12 @@ export async function muteUser( if (theCase) { // Update old case const noteDetails = [`Mute updated to ${muteTime ? timeUntilUnmuteStr : "indefinite"}`]; - const reasons = reason ? [reason] : []; + const reasons = reason ? [reason] : [""]; // Empty string so that there is a case update even without reason + if (muteOptions.caseArgs?.extraNotes) { reasons.push(...muteOptions.caseArgs.extraNotes); } + for (const noteReason of reasons) { await casesPlugin.createCaseNote({ caseId: existingMute!.case_id,