From 8ac459777b13275581b7060d60cf28674bb24157 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 21 Oct 2019 14:23:15 -0300 Subject: [PATCH] Bug 23858: Make POST add the Location header on vendors endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit According to the coding guidelines, this endpoint should be adding the Location header on POST actions. To test: 1. Apply the tests patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/acquisitions_vendors.t => FAIL: Tests fail! 3. Apply this patch 4. Repeat (1) => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Joonas Kylmälä Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- Koha/REST/V1/Acquisitions/Vendors.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/REST/V1/Acquisitions/Vendors.pm b/Koha/REST/V1/Acquisitions/Vendors.pm index f5686b0ded..a051c2e7ee 100644 --- a/Koha/REST/V1/Acquisitions/Vendors.pm +++ b/Koha/REST/V1/Acquisitions/Vendors.pm @@ -101,6 +101,7 @@ sub add_vendor { return try { $vendor->store; + $c->res->headers->location($c->req->url->to_string . '/' . $vendor->id ); return $c->render( status => 200, openapi => $vendor->to_api -- 2.39.5