api, backend: replace '+( { ... } )' -> '+{ ... }'

api, backend: whitespace: '+( {' -> '+({'
This commit is contained in:
Lucas 2023-02-19 15:15:57 +00:00
parent 861593d26d
commit 7d827212c1
2 changed files with 11 additions and 11 deletions

View File

@ -58,11 +58,11 @@ get "/" => sub {
send_error("API error", 500) if !$res->{success};
my $data = decode_json($res->{content});
my @media = map +( {
my @media = map +{
# XXX point to a cache
image_src => "$POORBOORU_API/download/$_",
view_uri => uri_for("/view/$_"),
} ), @{$data->{media}};
}, @{$data->{media}};
template "gallery" => {
title => "PoorBooru",
@ -81,11 +81,11 @@ get "/tags" => sub {
send_error("API error", 500) if !$res->{success};
my $data = decode_json($res->{content});
my @tags = map +( {
my @tags = map +{
name => $_->{name},
count => $_->{count},
uri => uri_for("/tag/" . $_->{name}),
} ), @{$data->{tags}};
}, @{$data->{tags}};
template "tags" => {
title => "Tags",
@ -101,11 +101,11 @@ get "/tag/:tag_id_or_name" => sub {
send_error("API error", 500) if !$res->{success};
my $data = decode_json($res->{content});
my @media = map +( {
my @media = map +{
# XXX point to a cache
image_src => "$POORBOORU_API/download/$_",
view_uri => uri_for("/view/$_"),
} ), @{$data->{media}};
}, @{$data->{media}};
template "gallery" => {
title => $data->{name},

View File

@ -53,11 +53,11 @@ get "/tags" => sub {
my $paged_tags = schema("default")->resultset("TagsCountView")
->search({}, $TAGS_COUNT_VIEW_SEARCH_OPTS)->page($page);
my @tags = map +( {
my @tags = map +{
id => $_->tag_id,
name => $_->name,
count => $_->count,
} ), $paged_tags->all;
}, $paged_tags->all;
return {
pager => mkpager($paged_tags),
@ -74,11 +74,11 @@ post "/tags" => sub {
my @tags;
eval {
@tags = map +( {
@tags = map +{
id => $_->tag_id,
name => $_->name,
} ), schema("default")->resultset("Tag")
->populate([map +({ name => $_ }), @tag_names]);
}, schema("default")->resultset("Tag")
->populate([map +{ name => $_ }, @tag_names]);
} or send_error("Tag exists", 409);
return \@tags;