From e30fd9e390b7f8b3d10c2e400909324ceac4cc00 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 4 Jan 2021 09:59:49 -0300 Subject: [PATCH] Bug 23857: Make adding club holds set the Location header This patch makes the club holds route add the Location header to the response as specified in the API coding guidelines. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/clubs_holds.t => FAIL: Tests don't pass! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: David Nind --- Koha/REST/V1/Clubs/Holds.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/REST/V1/Clubs/Holds.pm b/Koha/REST/V1/Clubs/Holds.pm index 78f741acd0..4fad9c3938 100644 --- a/Koha/REST/V1/Clubs/Holds.pm +++ b/Koha/REST/V1/Clubs/Holds.pm @@ -121,6 +121,8 @@ sub add { default_patron_home => $default_patron_home }); + $c->res->headers->location( $c->req->url->to_string . '/' ); + return $c->render( status => 201, openapi => $club_hold->to_api -- 2.11.0