From 15eb65c77860709bfc42cd22b099a80df5f70a83 Mon Sep 17 00:00:00 2001
From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Date: Tue, 17 Apr 2018 12:00:15 +0100
Subject: [PATCH] Bug 20581: API provide status_alias embed
- 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
---
Koha/REST/V1/Illrequests.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Koha/REST/V1/Illrequests.pm b/Koha/REST/V1/Illrequests.pm
index 434bc1f164..376e272a13 100644
--- a/Koha/REST/V1/Illrequests.pm
+++ b/Koha/REST/V1/Illrequests.pm
@@ -158,6 +158,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;
}
--
2.11.0