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 {
|
get "/tags" => sub {
|
||||||
my @tags = schema("default")->resultset("TagsCountView")->all;
|
my @tags = map +( {
|
||||||
|
id => $_->tag_id,
|
||||||
|
name => $_->name,
|
||||||
|
count => $_->count,
|
||||||
|
} ), schema("default")->resultset("TagsCountView")->all;
|
||||||
|
|
||||||
return [
|
return \@tags;
|
||||||
map +( {
|
|
||||||
id => $_->tag_id,
|
|
||||||
name => $_->name,
|
|
||||||
count => $_->count,
|
|
||||||
} ), @tags,
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
post "/tags/new" => sub {
|
post "/tags/new" => sub {
|
||||||
|
Loading…
Reference in New Issue
Block a user