api/v0: remove duplicates from tags in list_media
This commit is contained in:
parent
e178a261e6
commit
d1031a9162
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
||||||
package Pooru::API::V0::Controller::Media;
|
package Pooru::API::V0::Controller::Media;
|
||||||
use Mojo::Base "Mojolicious::Controller", -signatures;
|
use Mojo::Base "Mojolicious::Controller", -signatures;
|
||||||
|
|
||||||
|
use List::Util qw(uniq);
|
||||||
|
|
||||||
my %search_opts = Pooru::API::V0::_search_opts->%*;
|
my %search_opts = Pooru::API::V0::_search_opts->%*;
|
||||||
|
|
||||||
sub _list_no_tags ($self, $page)
|
sub _list_no_tags ($self, $page)
|
||||||
|
@ -64,7 +66,7 @@ sub list ($self)
|
||||||
status => 400,
|
status => 400,
|
||||||
) if $v->has_error;
|
) if $v->has_error;
|
||||||
|
|
||||||
my @tags = split(" ", $v->optional("tags")->param // "");
|
my @tags = uniq split(" ", $v->optional("tags")->param // "");
|
||||||
return $self->render(
|
return $self->render(
|
||||||
json => {error => "Invalid tags."},
|
json => {error => "Invalid tags."},
|
||||||
status => 400,
|
status => 400,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue