Great suggestion by @ology@fosstodon.org

This commit is contained in:
swag 2022-12-08 18:19:09 -06:00
parent f6eb0dfc05
commit babd302ba2

View File

@ -4,18 +4,13 @@ use Mojo::Base 'Mojolicious::Controller', -signatures;
sub flagged($self) { sub flagged($self) {
my $flagged_posts = $self->moderator->flagged; my $flagged_posts = $self->moderator->flagged;
my $post_links = [ my @post_links = map {
map { $self->url_for(
if ($_->{'type'} eq 'thread') { 'single_' . $_->{'type'}, $_->{'type'} . '_id' => $_->{'id'}
$self->url_for(single_thread => thread_id => $_->{'id'}) )
} } @{$flagged_posts};
else {
$self->url_for(single_remark => remark_id => $_->{'id'})
}
} @{$flagged_posts}
];
$self->stash(post_links => $post_links); $self->stash(post_links => \@post_links);
$self->render; $self->render;
} }