From 67c09e1d06b5c5555ebcc3db7268090b60513f1d Mon Sep 17 00:00:00 2001 From: Jacob O'Mara Date: Thu, 30 Oct 2025 11:41:13 +0000 Subject: [PATCH] Bug 17387: add items embed to deleted biblios API --- Koha/Old/Biblio.pm | 14 ++++++++++++++ api/v1/swagger/paths/deleted_biblios.yaml | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/Koha/Old/Biblio.pm b/Koha/Old/Biblio.pm index 7984fb918d2..df6bd29c2ba 100644 --- a/Koha/Old/Biblio.pm +++ b/Koha/Old/Biblio.pm @@ -25,6 +25,7 @@ use Koha::Biblioitem; use Koha::Biblio::Metadata; use Koha::Old::Biblio::Metadatas; use Koha::Old::Biblioitems; +use Koha::Old::Items; use Koha::SearchEngine::Indexer; =head1 NAME @@ -93,6 +94,19 @@ sub biblioitem { return Koha::Old::Biblioitems->find( { biblionumber => $self->biblionumber } ); } +=head3 items + +my $items = $deleted_biblio->items; + +Returns the related Koha::Old::Items for this deleted biblio + +=cut + +sub items { + my ($self) = @_; + return Koha::Old::Items->search( { biblionumber => $self->biblionumber } ); +} + =head3 to_api my $json = $deleted_biblio->to_api; diff --git a/api/v1/swagger/paths/deleted_biblios.yaml b/api/v1/swagger/paths/deleted_biblios.yaml index dff1890ea9d..f86913c8f53 100644 --- a/api/v1/swagger/paths/deleted_biblios.yaml +++ b/api/v1/swagger/paths/deleted_biblios.yaml @@ -14,6 +14,15 @@ - $ref: "../swagger.yaml#/parameters/q_param" - $ref: "../swagger.yaml#/parameters/q_body" - $ref: "../swagger.yaml#/parameters/request_id_header" + - name: x-koha-embed + in: header + required: false + description: Embed list sent as a request header + type: array + items: + type: string + enum: + - items produces: - application/json - application/marcxml+xml -- 2.39.5