Bugzilla – Attachment 153856 Details for
Bug 34365
Hold cancellation request workflow cannot be triggered on API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34365: Add cancellation request flow to DELETE /holds
Bug-34365-Add-cancellation-request-flow-to-DELETE-.patch (text/plain), 1.31 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-07-24 19:58:58 UTC
(
hide
)
Description:
Bug 34365: Add cancellation request flow to DELETE /holds
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-07-24 19:58:58 UTC
Size:
1.31 KB
patch
obsolete
>From 42776909c615447cf0a9c184f8d54d5966ecad39 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 24 Jul 2023 16:08:50 -0300 >Subject: [PATCH] Bug 34365: Add cancellation request flow to DELETE /holds > >This patch adds a new `x-koha-override` header to allow enforcing the >cancellation request flow for waiting holds. > >If the hold is not waiting, the header has no effect. > >To test: >1. Apply the tests patch >2. Run: > $ ktd --shell > k$ prove t/db_dependent/api/v1/holds.t >=> FAIL: The endpoint doesn't implement the required logic >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! The endpoint behavior is changed! >5. Sign off :-D >--- > Koha/REST/V1/Holds.pm | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index 00f761511d4..79deaaac259 100644 >--- a/Koha/REST/V1/Holds.pm >+++ b/Koha/REST/V1/Holds.pm >@@ -317,6 +317,19 @@ sub delete { > } > > return try { >+ >+ my $overrides = $c->stash('koha.overrides'); >+ >+ if ( $overrides->{'cancellation-request-flow'} && $hold->is_waiting ) { >+ >+ $hold->add_cancellation_request; >+ >+ return $c->render( >+ status => 202, >+ openapi => q{}, >+ ); >+ } >+ > $hold->cancel; > > return $c->render( >-- >2.39.2
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 34365
:
153855
|
153856
|
153935
|
153936
|
154154
|
154155