From b3c9e95face6b2b253d8af187be18ec3fbf541be Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 11 Jul 2022 13:07:28 +0100 Subject: [PATCH] Bug 31128: Add effective_not_for_loan_status into items response Signed-off-by: Nick Clemens Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- Koha/Item.pm | 1 + api/v1/swagger/definitions/item.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Koha/Item.pm b/Koha/Item.pm index a493cf15fa..23a66dc534 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -1342,6 +1342,7 @@ sub to_api { my $overrides = {}; $overrides->{effective_item_type_id} = $self->effective_itemtype; + $overrides->{effective_not_for_loan_status} = $self->notforloan ? $self->notforloan : $self->itemtype->notforloan; return { %$response, %$overrides }; } diff --git a/api/v1/swagger/definitions/item.yaml b/api/v1/swagger/definitions/item.yaml index 38ff3c25cd..069c0faebc 100644 --- a/api/v1/swagger/definitions/item.yaml +++ b/api/v1/swagger/definitions/item.yaml @@ -60,6 +60,9 @@ properties: not_for_loan_status: type: integer description: Authorized value defining why this item is not for loan + effective_not_for_loan_status: + type: integer + description: Authorized value defining why this item is not for not_for_loan_status damaged_status: type: integer description: Authorized value defining this item as damaged -- 2.39.5