api: use more compact code in /tags

This commit is contained in:
Lucas 2023-02-19 09:04:00 +00:00
parent 6eae4e0fe4
commit 420fc9ce97

View File

@ -38,15 +38,13 @@ get "/meta" => sub {
};
get "/tags" => sub {
my @tags = schema("default")->resultset("TagsCountView")->all;
return [
map +( {
my @tags = map +( {
id => $_->tag_id,
name => $_->name,
count => $_->count,
} ), @tags,
];
} ), schema("default")->resultset("TagsCountView")->all;
return \@tags;
};
post "/tags/new" => sub {