Bug 17387: (follow-up) fix embed items on get deleted biblio

Add x-koha-embed parameter to GET /deleted/biblios/{biblio_id} and use
$c->objects->to_api() to properly handle embedding items.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jacob O'Mara 2026-03-25 14:41:45 +00:00 committed by Lucas Gass
parent 8681b48fdb
commit b6eeffb79f
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
3 changed files with 12 additions and 1 deletions

View File

@ -59,7 +59,7 @@ sub get {
if ( $c->req->headers->accept =~ m/application\/json/ ) {
return $c->render(
status => 200,
json => $biblio->to_api
json => $c->objects->to_api($biblio),
);
} else {
my $metadata = $biblio->metadata;

View File

@ -81,6 +81,16 @@
summary: Get deleted biblio
parameters:
- $ref: "../swagger.yaml#/parameters/biblio_id_pp"
- name: x-koha-embed
in: header
required: false
description: Embed list sent as a request header
type: array
items:
type: string
enum:
- items
collectionFormat: csv
produces:
- application/json
- application/marcxml+xml

View File

@ -576,6 +576,7 @@
url: "/api/v1/deleted/biblios/" + biblio_id,
type: "GET",
headers: {
"Accept": "application/json",
"x-koha-embed": "items",
},
success: function (biblio) {