From 45cd9b056e68df38f38390cde62616d7353351ee Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Wed, 31 Oct 2018 15:25:17 +0000 Subject: [PATCH] Bug 20996: (follow-up) Fix merge problems Merge conflicts resolved --- Koha/Illrequest.pm | 30 ------------------------------ Koha/REST/V1/Illrequests.pm | 3 +++ 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index 1d2f911330..0b574d8910 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -1005,36 +1005,6 @@ sub TO_JSON { my $object = $self->SUPER::TO_JSON(); $object->{id_prefix} = $self->id_prefix; - if ( scalar (keys %$embed) ) { - # Augment the request response with patron details if appropriate - if ( $embed->{patron} ) { - my $patron = $self->patron; - $object->{patron} = { - firstname => $patron->firstname, - surname => $patron->surname, - cardnumber => $patron->cardnumber - }; - } - # Augment the request response with metadata details if appropriate - if ( $embed->{metadata} ) { - $object->{metadata} = $self->metadata; - } - # Augment the request response with status details if appropriate - if ( $embed->{capabilities} ) { - $object->{capabilities} = $self->capabilities; - } - # Augment the request response with library details if appropriate - if ( $embed->{library} ) { - $object->{library} = Koha::Libraries->find( - $self->branchcode - )->TO_JSON; - } - # Augment the request response with the number of comments if appropriate - if ( $embed->{comments} ) { - $object->{comments} = $self->illcomments->count; - } - } - return $object; } diff --git a/Koha/REST/V1/Illrequests.pm b/Koha/REST/V1/Illrequests.pm index 0a6dee0e2b..0b4c8f0d2a 100644 --- a/Koha/REST/V1/Illrequests.pm +++ b/Koha/REST/V1/Illrequests.pm @@ -137,6 +137,9 @@ sub list { if ($embed{capabilities}) { $to_push->{capabilities} = $to_fetch->{$req->backend}; } + if ($embed{comments}) { + $to_push->{comments} = $req->illcomments->count; + } push @output, $to_push; } -- 2.11.0