site: make /search always return JSON

This commit is contained in:
Lucas Gabriel Vuotto 2025-04-28 12:24:33 +00:00
parent 41f759c566
commit ba424dcb02

View file

@ -38,7 +38,7 @@ sub search ($self)
my $v = $self->validation;
my $q = $v->required("q")->param;
return $self->render(status => 400) if $v->has_error;
return $self->render(json => [], status => 400) if $v->has_error;
return $self->render(json => []) if $q eq "";