Bug 17387: add items embed to deleted biblios API

Signed-off-by: Michaela <michaela.sieber@kit.edu>
Sponsored-by: ByWater Solutions
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jacob O'Mara 2025-10-30 11:41:13 +00:00 committed by Lucas Gass
parent 2191941971
commit 4c3cf66681
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 23 additions and 0 deletions

View File

@ -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;

View File

@ -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