Fixed back-end alert verification.

This commit is contained in:
DebaucheryLibrarian 2024-03-28 01:19:13 +01:00
parent 7808ce452f
commit db1b72f95f
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ async function addAlert(alert, sessionUser) {
throw new HttpError('You are not authenthicated', 401);
}
if (!alert.actors?.length > 0 && !alert.tags?.length > 0 && !alert.entity && !alert.matches?.length > 0) {
if ((!alert.actors || alert.actors.length === 0) && (!alert.tags || alert.tags.length === 0) && (!alert.entities || alert.entities.length === 0) && (!alert.matches || alert.matches.length === 0)) {
throw new HttpError('Alert must contain at least one actor, tag or entity', 400);
}