api: make _pager a helper
This commit is contained in:
parent
fa07cf5645
commit
95beb0a599
3 changed files with 7 additions and 9 deletions
|
@ -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;
|
||||
|
||||
|
|
Reference in a new issue