mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2026-04-25 07:36:49 -05:00
chore: update empty post checks
This commit is contained in:
parent
d91540fdae
commit
c81d3b863e
|
|
@ -169,7 +169,7 @@ router.post('/', upload.none(), async function (request: express.Request, respon
|
|||
return;
|
||||
}
|
||||
|
||||
if (messageBody === '' && painting === '' && screenshot === '') {
|
||||
if (!messageBody?.trim() && !painting?.trim() && !screenshot?.trim()) {
|
||||
response.status(422);
|
||||
LOG_WARN('[Messages] message content is empty');
|
||||
response.redirect(`/friend_messages/${conversation.id}`);
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ async function newPost(request: express.Request, response: express.Response): Pr
|
|||
return;
|
||||
}
|
||||
|
||||
if ((!messageBody || messageBody === '') && painting === '' && screenshot === '') {
|
||||
if (!messageBody?.trim() && !painting?.trim() && !screenshot?.trim()) {
|
||||
response.status(400);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user