fix(backend): renoteIdまたはfileIdsmediaIds)またはpollnullでない場合に、text が空白文字のみで構成されたリクエストになることを許可して、結果はtext: null`を返すように

This commit is contained in:
zyoshoka 2024-01-12 15:45:42 +09:00
parent dc381180e8
commit 9930881809
No known key found for this signature in database
GPG key ID: 0C2CB8FBA309A5B8
2 changed files with 3 additions and 1 deletions

View file

@ -325,6 +325,9 @@ export class NoteCreateService implements OnApplicationShutdown {
data.text = data.text.slice(0, DB_MAX_NOTE_TEXT_LENGTH); data.text = data.text.slice(0, DB_MAX_NOTE_TEXT_LENGTH);
} }
data.text = data.text.trim(); data.text = data.text.trim();
if (data.text === '') {
data.text = null;
}
} else { } else {
data.text = null; data.text = null;
} }

View file

@ -138,7 +138,6 @@ export const paramDef = {
minLength: 1, minLength: 1,
maxLength: MAX_NOTE_TEXT_LENGTH, maxLength: MAX_NOTE_TEXT_LENGTH,
nullable: true, nullable: true,
pattern: '[^\\s]+',
}, },
fileIds: { fileIds: {
type: 'array', type: 'array',