Reject blocklist-by-query API requests with no query.

This commit is contained in:
Kailash Nadh 2024-11-05 00:11:44 +05:30
parent ac5e10158a
commit 1ac9ccbb8b

View file

@ -462,6 +462,10 @@ func handleBlocklistSubscribersByQuery(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.BlocklistSubscribersByQuery(req.Query, req.ListIDs, req.SubscriptionStatus); err != nil {
return err
}