From 072b4d9946384082e60432e08511fa6b1e4ac812 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 23 Jun 2023 21:18:04 -0700 Subject: [PATCH] fix: :bug: remove cw in post edit Closes #10353 --- packages/backend/src/server/api/endpoints/notes/edit.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/edit.ts b/packages/backend/src/server/api/endpoints/notes/edit.ts index 90a4f4ded..511ea618c 100644 --- a/packages/backend/src/server/api/endpoints/notes/edit.ts +++ b/packages/backend/src/server/api/endpoints/notes/edit.ts @@ -527,9 +527,12 @@ export default define(meta, paramDef, async (ps, user) => { if (ps.text !== note.text) { update.text = ps.text; } - if (ps.cw !== note.cw) { + if (ps.cw !== note.cw || (ps.cw && !note.cw)) { update.cw = ps.cw; } + else if (!ps.cw && note.cw) { + update.cw = null; + } if (ps.visibility !== note.visibility) { update.visibility = ps.visibility; }