api: use more compact code in /tags
This commit is contained in:
parent
6eae4e0fe4
commit
420fc9ce97
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user