fix(backend): renoteId
またはfileIds
(mediaIds
)またはpoll
がnull
でない場合に、text が空白文字のみで構成されたリクエストになることを許可して、結果は
text: null`を返すように
This commit is contained in:
parent
dc381180e8
commit
9930881809
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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',
|
||||||
|
|
Loading…
Reference in a new issue