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:
parent
8681b48fdb
commit
b6eeffb79f
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -576,6 +576,7 @@
|
|||
url: "/api/v1/deleted/biblios/" + biblio_id,
|
||||
type: "GET",
|
||||
headers: {
|
||||
"Accept": "application/json",
|
||||
"x-koha-embed": "items",
|
||||
},
|
||||
success: function (biblio) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue