Bugzilla – Attachment 173158 Details for
Bug 30660
Add cancellation reason to holds delete endpoint
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30660: Add cancellation reason to holds delete endpoint
Bug-30660-Add-cancellation-reason-to-holds-delete-.patch (text/plain), 2.15 KB, created by
Pedro Amorim
on 2024-10-22 14:15:22 UTC
(
hide
)
Description:
Bug 30660: Add cancellation reason to holds delete endpoint
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-10-22 14:15:22 UTC
Size:
2.15 KB
patch
obsolete
>From 017dde37c16df81f878a653a1d6f65a73d03aa3e Mon Sep 17 00:00:00 2001 >From: Johanna Raisa <johanna.raisa@gmail.com> >Date: Mon, 2 May 2022 11:49:11 +0300 >Subject: [PATCH] Bug 30660: Add cancellation reason to holds delete endpoint > >This patch adds cancellation reason to holds delete endpoint. > >Test plan: >1) prove t/db_dependent/api/v1/holds.t > >PA amended: tidy > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > Koha/REST/V1/Holds.pm | 3 ++- > api/v1/swagger/paths/holds.yaml | 6 ++++++ > t/db_dependent/api/v1/holds.t | 2 +- > 3 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index ac9979e0ba..4d3c71684a 100644 >--- a/Koha/REST/V1/Holds.pm >+++ b/Koha/REST/V1/Holds.pm >@@ -328,7 +328,8 @@ sub delete { > ); > } > >- $hold->cancel; >+ my $cancellation_reason = $c->req->json; >+ $hold->cancel( { cancellation_reason => $cancellation_reason } ); > > return $c->render_resource_deleted; > } >diff --git a/api/v1/swagger/paths/holds.yaml b/api/v1/swagger/paths/holds.yaml >index abf00fd726..519f7ac0d7 100644 >--- a/api/v1/swagger/paths/holds.yaml >+++ b/api/v1/swagger/paths/holds.yaml >@@ -403,6 +403,12 @@ > summary: Cancel hold > parameters: > - $ref: "../swagger.yaml#/parameters/hold_id_pp" >+ - name: body >+ in: body >+ description: Cancellation reason >+ required: false >+ schema: >+ type: string > - name: x-koha-override > in: header > required: false >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 8632c25940..95c9a8cc2a 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -234,7 +234,7 @@ subtest "Test endpoints with permission" => sub { > ->status_is(200) > ->json_is([]); > >- $t->delete_ok( "//$userid_3:$password@/api/v1/holds/$reserve_id2" ) >+ $t->delete_ok( "//$userid_3:$password@/api/v1/holds/$reserve_id2" => json => "Cancellation reason" ) > ->status_is(204, 'SWAGGER3.2.4') > ->content_is('', 'SWAGGER3.3.4'); > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30660
:
139941
|
170557
|
170559
| 173158