api: make _pager a helper

This commit is contained in:
Lucas 2023-03-10 20:41:52 +00:00
parent fa07cf5645
commit 95beb0a599
3 changed files with 7 additions and 9 deletions

View file

@ -17,6 +17,10 @@ sub startup ($self)
$self->helper(schema => sub {
state $schema = PoorBooru::Schema->connect($config->{dsn})
});
$self->helper(pager => sub ($, $dbp) {
map +( $_ => $dbp->$_ ), qw(first_page previous_page
current_page next_page last_page)
});
my $r = $self->routes;