View | Details | Raw Unified | Return to bug 20996
Collapse All | Expand All

(-)a/Koha/Illrequest.pm (-30 lines)
Lines 1020-1055 sub TO_JSON { Link Here
1020
    my $object = $self->SUPER::TO_JSON();
1020
    my $object = $self->SUPER::TO_JSON();
1021
    $object->{id_prefix} = $self->id_prefix;
1021
    $object->{id_prefix} = $self->id_prefix;
1022
1022
1023
    if ( scalar (keys %$embed) ) {
1024
        # Augment the request response with patron details if appropriate
1025
        if ( $embed->{patron} ) {
1026
            my $patron = $self->patron;
1027
            $object->{patron} = {
1028
                firstname  => $patron->firstname,
1029
                surname    => $patron->surname,
1030
                cardnumber => $patron->cardnumber
1031
            };
1032
        }
1033
        # Augment the request response with metadata details if appropriate
1034
        if ( $embed->{metadata} ) {
1035
            $object->{metadata} = $self->metadata;
1036
        }
1037
        # Augment the request response with status details if appropriate
1038
        if ( $embed->{capabilities} ) {
1039
            $object->{capabilities} = $self->capabilities;
1040
        }
1041
        # Augment the request response with library details if appropriate
1042
        if ( $embed->{library} ) {
1043
            $object->{library} = Koha::Libraries->find(
1044
                $self->branchcode
1045
            )->TO_JSON;
1046
        }
1047
        # Augment the request response with the number of comments if appropriate
1048
        if ( $embed->{comments} ) {
1049
            $object->{comments} = $self->illcomments->count;
1050
        }
1051
    }
1052
1053
    return $object;
1023
    return $object;
1054
}
1024
}
1055
1025
(-)a/Koha/REST/V1/Illrequests.pm (-1 / +3 lines)
Lines 137-142 sub list { Link Here
137
        if ($embed{capabilities}) {
137
        if ($embed{capabilities}) {
138
            $to_push->{capabilities} = $to_fetch->{$req->backend};
138
            $to_push->{capabilities} = $to_fetch->{$req->backend};
139
        }
139
        }
140
        if ($embed{comments}) {
141
            $to_push->{comments} = $req->illcomments->count;
142
        }
140
        push @output, $to_push;
143
        push @output, $to_push;
141
    }
144
    }
142
145
143
- 

Return to bug 20996