From 993088180944eeb3e3e18caf880f71c5f87079f1 Mon Sep 17 00:00:00 2001 From: zyoshoka Date: Fri, 12 Jan 2024 15:45:42 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20`renoteId`=E3=81=BE=E3=81=9F?= =?UTF-8?q?=E3=81=AF`fileIds`=EF=BC=88`mediaIds`=EF=BC=89=E3=81=BE?= =?UTF-8?q?=E3=81=9F=E3=81=AF`poll`=E3=81=8C`null`=E3=81=A7=E3=81=AA?= =?UTF-8?q?=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AB=E3=80=81`text=20=20?= =?UTF-8?q?=E3=81=8C=E7=A9=BA=E7=99=BD=E6=96=87=E5=AD=97=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E3=81=A7=E6=A7=8B=E6=88=90=E3=81=95=E3=82=8C=E3=81=9F=E3=83=AA?= =?UTF-8?q?=E3=82=AF=E3=82=A8=E3=82=B9=E3=83=88=E3=81=AB=E3=81=AA=E3=82=8B?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=82=92=E8=A8=B1=E5=8F=AF=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=80=81=E7=B5=90=E6=9E=9C=E3=81=AF`text:=20null`=E3=82=92?= =?UTF-8?q?=E8=BF=94=E3=81=99=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/NoteCreateService.ts | 3 +++ packages/backend/src/server/api/endpoints/notes/create.ts | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 97fb80ab39..30f6d07118 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -325,6 +325,9 @@ export class NoteCreateService implements OnApplicationShutdown { data.text = data.text.slice(0, DB_MAX_NOTE_TEXT_LENGTH); } data.text = data.text.trim(); + if (data.text === '') { + data.text = null; + } } else { data.text = null; } diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index ed522e03c9..0cd0d4d6ec 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -138,7 +138,6 @@ export const paramDef = { minLength: 1, maxLength: MAX_NOTE_TEXT_LENGTH, nullable: true, - pattern: '[^\\s]+', }, fileIds: { type: 'array',