From c5286a4174d6a0485cb270c48ca7afe74e64a70e Mon Sep 17 00:00:00 2001 From: GrapeApple0 <84321396+GrapeApple0@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:42:41 +0000 Subject: [PATCH] =?UTF-8?q?api.json=E3=81=AE=E5=87=BA=E5=8A=9B=E7=B5=90?= =?UTF-8?q?=E6=9E=9C=E3=81=AE=E6=AD=A3=E7=A2=BA=E6=80=A7=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/notes/update.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/notes/update.ts b/packages/backend/src/server/api/endpoints/notes/update.ts index 9af98ffa83..6bc0e3d7f9 100644 --- a/packages/backend/src/server/api/endpoints/notes/update.ts +++ b/packages/backend/src/server/api/endpoints/notes/update.ts @@ -89,6 +89,34 @@ export const paramDef = { required: ['choices'], }, }, + // (re)note with text, files and poll are optional + if: { + properties: { + renoteId: { + type: 'null', + }, + fileIds: { + type: 'null', + }, + mediaIds: { + type: 'null', + }, + poll: { + type: 'null', + }, + }, + }, + then: { + properties: { + text: { + type: 'string', + minLength: 1, + maxLength: MAX_NOTE_TEXT_LENGTH, + pattern: '[^\\s]+', + }, + }, + required: ['text'], + }, required: ['noteId', 'text', 'cw'], } as const;