Bugzilla – Attachment 147825 Details for
Bug 33080
Add helpers that return result_set for further processing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33080: Adapt other use-cases
Bug-33080-Adapt-other-use-cases.patch (text/plain), 3.90 KB, created by
Tomás Cohen Arazi
on 2023-03-07 11:42:12 UTC
(
hide
)
Description:
Bug 33080: Adapt other use-cases
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2023-03-07 11:42:12 UTC
Size:
3.90 KB
patch
obsolete
>From 5938c609590d7de10ed9a506b9b0e45dda426d8a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 7 Mar 2023 08:26:51 -0300 >Subject: [PATCH] Bug 33080: Adapt other use-cases > >This patch adapts the other controllers that rely on >add_pagination_headers outside of `objects.search`. > >To test: >1. Apply this patchset >2. Run: > $ ktd --shell > $ prove t/db_dependent/api/v1/* \ > t/db_dependent/Koha/REST/Plugin/Objects.t \ > t/db_dependent/Koha/REST/Plugin/Pagination.t >=> SUCCESS: Tests pass! >3. Sign off :-D >--- > Koha/REST/V1/Acquisitions/Orders.pm | 8 +++++--- > Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm | 8 +++++--- > Koha/REST/V1/ERM/EHoldings/Resources/EBSCO.pm | 8 +++++--- > Koha/REST/V1/ERM/EHoldings/Titles/EBSCO.pm | 8 +++++--- > 4 files changed, 20 insertions(+), 12 deletions(-) > >diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm >index ae9c1bafbcb..d5a0fe73c6e 100644 >--- a/Koha/REST/V1/Acquisitions/Orders.pm >+++ b/Koha/REST/V1/Acquisitions/Orders.pm >@@ -183,9 +183,11 @@ sub list { > > $c->add_pagination_headers( > { >- total => ($orders->is_paged ? $orders->pager->total_entries : $orders->count), >- base_total => $total, >- params => $args, >+ base_total => $total, >+ page => $reserved_params->{_page}, >+ per_page => $reserved_params->{_per_page}, >+ query_params => $args, >+ total => ( $orders->is_paged ? $orders->pager->total_entries : $orders->count ), > } > ); > >diff --git a/Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm b/Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm >index defd5ea0a7c..ccdad769222 100644 >--- a/Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm >+++ b/Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm >@@ -60,9 +60,11 @@ sub list { > > $c->add_pagination_headers( > { >- base_total => $base_total, >- total => $total, >- params => $args, >+ base_total => $base_total, >+ page => $args->{_page}, >+ per_page => $args->{_per_page}, >+ query_params => $args, >+ total => $total, > } > ); > return $c->render( status => 200, openapi => \@packages ); >diff --git a/Koha/REST/V1/ERM/EHoldings/Resources/EBSCO.pm b/Koha/REST/V1/ERM/EHoldings/Resources/EBSCO.pm >index abd4433ac8e..a404c03998d 100644 >--- a/Koha/REST/V1/ERM/EHoldings/Resources/EBSCO.pm >+++ b/Koha/REST/V1/ERM/EHoldings/Resources/EBSCO.pm >@@ -104,9 +104,11 @@ sub list { > $total = 10000 if $total > 10000; > $c->add_pagination_headers( > { >- base_total => $base_total, >- total => $total, >- params => $args, >+ base_total => $base_total, >+ page => $page, >+ per_page => $per_page, >+ query_params => $args, >+ total => $total, > } > ); > return $c->render( status => 200, openapi => \@resources ); >diff --git a/Koha/REST/V1/ERM/EHoldings/Titles/EBSCO.pm b/Koha/REST/V1/ERM/EHoldings/Titles/EBSCO.pm >index cf3c788cdae..05c672c7fb0 100644 >--- a/Koha/REST/V1/ERM/EHoldings/Titles/EBSCO.pm >+++ b/Koha/REST/V1/ERM/EHoldings/Titles/EBSCO.pm >@@ -83,9 +83,11 @@ sub list { > > $c->add_pagination_headers( > { >- #base_total => $base_total, >- total => $total, >- params => $args, >+ #base_total => $base_total, >+ page => $page, >+ per_page => $per_page, >+ query_params => $args, >+ total => $total, > } > ); > return $c->render( status => 200, openapi => \@titles ); >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33080
:
147469
|
147662
|
147663
|
147720
|
147734
|
147735
|
147736
|
147788
|
147789
|
147790
|
147823
|
147824
|
147825
|
148020
|
148021
|
148022
|
148071
|
148072
|
148073