Bugzilla – Attachment 157899 Details for
Bug 33960
Add ability to retrieve deleted bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33960: Add deleted option ot biblios endpoint
Bug-33960-Add-deleted-option-ot-biblios-endpoint.patch (text/plain), 2.29 KB, created by
Martin Renvoize (ashimema)
on 2023-10-26 10:33:51 UTC
(
hide
)
Description:
Bug 33960: Add deleted option ot biblios endpoint
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-10-26 10:33:51 UTC
Size:
2.29 KB
patch
obsolete
>From c3f0b9e7f10cc0a502ac8cc01e22fb22eb8156ab Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 8 Jun 2023 13:11:32 +0000 >Subject: [PATCH] Bug 33960: Add deleted option ot biblios endpoint > >This patch adds a 'deleted' parameter to the biblios endpoint. If this parameter is passed >the API will return deleted biblios rather than current ones > >To test: >1 - Apply patch >2 - GET http://localhost:8081/api/v1/biblios >3 - Confirm you can search and page >4 - add 'deleted' param to query >5 - Confirm you get dleted biblios information >6 - Confirm searching and paging work as expected > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/REST/V1/Biblios.pm | 5 ++++- > api/v1/swagger/paths/biblios.yaml | 4 ++++ > 2 files changed, 8 insertions(+), 1 deletion(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index eef084bc2c7..4f198ef7b6c 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -20,6 +20,7 @@ use Modern::Perl; > use Mojo::Base 'Mojolicious::Controller'; > > use Koha::Biblios; >+use Koha::Old::Biblios; > use Koha::DateUtils; > use Koha::Ratings; > use Koha::RecordProcessor; >@@ -802,7 +803,9 @@ sub list { > push @prefetch, 'metadata' # don't prefetch metadata if not needed > unless $c->req->headers->accept =~ m/application\/json/; > >- my $rs = Koha::Biblios->search( undef, { prefetch => \@prefetch }); >+ my $deleted = delete $c->param->{deleted}; >+ >+ my $rs = $deleted ? Koha::Old::Biblios->search() : Koha::Biblios->search( undef, { prefetch => \@prefetch } ); > my $biblios = $c->objects->search_rs( $rs, [(sub{ $rs->api_query_fixer( $_[0], '', $_[1] ) })] ); > > return try { >diff --git a/api/v1/swagger/paths/biblios.yaml b/api/v1/swagger/paths/biblios.yaml >index d250237b687..22d4ab4223c 100644 >--- a/api/v1/swagger/paths/biblios.yaml >+++ b/api/v1/swagger/paths/biblios.yaml >@@ -67,6 +67,10 @@ > - biblios > summary: List biblios > parameters: >+ - name: deleted >+ in: query >+ description: If information on deleted objects is requested >+ type: boolean > - $ref: "../swagger.yaml#/parameters/page" > - $ref: "../swagger.yaml#/parameters/per_page" > - $ref: "../swagger.yaml#/parameters/match" >-- >2.41.0
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 33960
:
152199
|
152200
|
152201
|
152215
|
155331
|
155332
|
155333
|
155334
|
155335
|
155416
|
155417
|
155418
|
155419
|
155420
|
157899
|
157900
|
157901
|
157902
|
157903
|
157904
|
158071
|
159998
|
159999
|
160000
|
160001
|
160002
|
160552
|
163852
|
163853
|
163854
|
163855
|
163948
|
163949
|
163950
|
163951