Reject query-by-delete API requests with no query. Ref #2122.

This commit is contained in:
Kailash Nadh 2024-11-04 14:01:30 +05:30
parent d8a394d0f4
commit ac5e10158a

View file

@ -439,6 +439,10 @@ func handleDeleteSubscribersByQuery(c echo.Context) error {
return err
}
if req.Query == "" {
return echo.NewHTTPError(http.StatusBadRequest, app.i18n.Ts("globals.messages.invalidFields", "name", "query"))
}
if err := app.core.DeleteSubscribersByQuery(req.Query, req.ListIDs, req.SubscriptionStatus); err != nil {
return err
}