Bugzilla – Attachment 152199 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.27 KB, created by
Nick Clemens (kidclamp)
on 2023-06-08 13:58:10 UTC
(
hide
)
Description:
Bug 33960: Add deleted option ot biblios endpoint
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-06-08 13:58:10 UTC
Size:
2.27 KB
patch
obsolete
>From 75dc30cf42b4a1b403bbb704aee3900e1bc9afa8 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 >--- > Koha/REST/V1/Biblios.pm | 7 ++++++- > api/v1/swagger/paths/biblios.yaml | 4 ++++ > 2 files changed, 10 insertions(+), 1 deletion(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 6457d49d7a..5aa09093b8 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; >@@ -797,12 +798,16 @@ Controller function that handles retrieving a single biblio object > sub list { > my $c = shift->openapi->valid_input or return; > >+ my $deleted = delete $c->validation->output->{deleted}; >+ > my $attributes; > $attributes = > { prefetch => ['metadata'] } # don't prefetch metadata if not needed > unless $c->req->headers->accept =~ m/application\/json/; > >- my $biblios = $c->objects->search_rs( Koha::Biblios->new ); >+ my $biblios = $deleted ? >+ $c->objects->search_rs( Koha::Old::Biblios->new ) : >+ $c->objects->search_rs( Koha::Biblios->new ); > > return try { > >diff --git a/api/v1/swagger/paths/biblios.yaml b/api/v1/swagger/paths/biblios.yaml >index fa98f152a5..6baa494e77 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.30.2
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