Bug 20581: API provide status_alias embed
authorAndrew Isherwood <andrew.isherwood@ptfs-europe.com>
Tue, 17 Apr 2018 11:00:15 +0000 (12:00 +0100)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 22 Feb 2019 14:31:31 +0000 (14:31 +0000)
- This patch provides the illrequests API route with an additional embed,
called 'status_alias'. Requesting this embed returns an object for the
request's status_alias authorised value, or null if one is not set.
- This patch also adds the new status_alias as a default embed on the API
call made by the illlist view

Signed-off-by: Niamh.Walker-Headon@it-tallaght.ie

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha/REST/V1/Illrequests.pm

index eb3a5cf..94ff8ce 100644 (file)
@@ -155,6 +155,9 @@ sub list {
         if ($embed{comments}) {
             $to_push->{comments} = $req->illcomments->count;
         }
+        if ($embed{status_alias}) {
+            $to_push->{status_alias} = $req->statusalias;
+        }
         push @output, $to_push;
     }