validate blank messages on backend

This commit is contained in:
ThatOneCalculator 2023-03-19 20:03:49 -07:00
parent 4c4c641804
commit 43bca8ed38
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ export default define(meta, paramDef, async (ps, user) => {
}
// テキストが無いかつ添付ファイルも無かったらエラー
if (ps.text == null && file == null) {
if ((ps.text == null || ps.text.trim() === '') && file == null) {
throw new ApiError(meta.errors.contentRequired);
}