From 5aaae31a78db533e998044d9f0bc16f7dfda06b1 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 17 Jun 2019 12:16:53 -0300 Subject: [PATCH] Bug 9834: (QA follow-up) API Corrections Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- Koha/REST/V1/Holds.pm | 2 ++ Koha/Schema/Result/Reserve.pm | 5 +++-- api/v1/swagger/definitions/hold.json | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm index 58ddf1f273..a74307ff72 100644 --- a/Koha/REST/V1/Holds.pm +++ b/Koha/REST/V1/Holds.pm @@ -464,6 +464,7 @@ our $to_api_mapping = { suspend => 'suspended', suspend_until => 'suspended_until', itemtype => 'item_type', + item_level_hold => 'item_level', }; =head3 $to_model_mapping @@ -486,6 +487,7 @@ our $to_model_mapping = { suspended => 'suspend', suspended_until => 'suspend_until', item_type => 'itemtype', + item_level => 'item_level_hold', }; 1; diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index 8b91618210..213df0816b 100644 --- a/Koha/Schema/Result/Reserve.pm +++ b/Koha/Schema/Result/Reserve.pm @@ -349,8 +349,9 @@ __PACKAGE__->belongs_to( ); __PACKAGE__->add_columns( - '+lowestPriority' => { is_boolean => 1 }, - '+suspend' => { is_boolean => 1 } + '+item_level_hold' => { is_boolean => 1 }, + '+lowestPriority' => { is_boolean => 1 }, + '+suspend' => { is_boolean => 1 } ); 1; diff --git a/api/v1/swagger/definitions/hold.json b/api/v1/swagger/definitions/hold.json index df8289823b..dda32600b3 100644 --- a/api/v1/swagger/definitions/hold.json +++ b/api/v1/swagger/definitions/hold.json @@ -74,6 +74,10 @@ "item_type": { "type": ["string", "null"], "description": "If record level hold, the optional itemtype of the item the patron is requesting" + }, + "item_level": { + "type": "boolean", + "description": "If the hold is placed at item level" } } } -- 2.39.5