Bugzilla – Attachment 94798 Details for
Bug 23858
Vendors endpoint not setting the Location header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23858: (follow-up) Return code fix
Bug-23858-follow-up-Return-code-fix.patch (text/plain), 2.47 KB, created by
Nick Clemens (kidclamp)
on 2019-10-25 18:52:30 UTC
(
hide
)
Description:
Bug 23858: (follow-up) Return code fix
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-10-25 18:52:30 UTC
Size:
2.47 KB
patch
obsolete
>From 3123e84b3493a4cfb5a9a5d66ba8be348609cf52 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 21 Oct 2019 14:32:25 -0300 >Subject: [PATCH] Bug 23858: (follow-up) Return code fix >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/REST/V1/Acquisitions/Vendors.pm | 2 +- > api/v1/swagger/paths/acquisitions_vendors.json | 2 +- > t/db_dependent/api/v1/acquisitions_vendors.t | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/REST/V1/Acquisitions/Vendors.pm b/Koha/REST/V1/Acquisitions/Vendors.pm >index a051c2e7ee..986b1ab8f6 100644 >--- a/Koha/REST/V1/Acquisitions/Vendors.pm >+++ b/Koha/REST/V1/Acquisitions/Vendors.pm >@@ -103,7 +103,7 @@ sub add_vendor { > $vendor->store; > $c->res->headers->location($c->req->url->to_string . '/' . $vendor->id ); > return $c->render( >- status => 200, >+ status => 201, > openapi => $vendor->to_api > ); > } >diff --git a/api/v1/swagger/paths/acquisitions_vendors.json b/api/v1/swagger/paths/acquisitions_vendors.json >index 4c86a8de87..f8da32f16a 100644 >--- a/api/v1/swagger/paths/acquisitions_vendors.json >+++ b/api/v1/swagger/paths/acquisitions_vendors.json >@@ -84,7 +84,7 @@ > "application/json" > ], > "responses": { >- "200": { >+ "201": { > "description": "Vendor added", > "schema": { > "$ref": "../definitions.json#/vendor" >diff --git a/t/db_dependent/api/v1/acquisitions_vendors.t b/t/db_dependent/api/v1/acquisitions_vendors.t >index 61fd1289f4..5ae7367de3 100644 >--- a/t/db_dependent/api/v1/acquisitions_vendors.t >+++ b/t/db_dependent/api/v1/acquisitions_vendors.t >@@ -222,7 +222,7 @@ subtest 'add() tests' => sub { > $tx->req->cookies( { name => 'CGISESSID', value => $authorized_session_id } ); > $tx->req->env( { REMOTE_ADDR => $remote_address } ); > my $vendor_id = $t->request_ok($tx) >- ->status_is(200) >+ ->status_is( 201, 'SWAGGER3 .2.1' ) > ->header_like( Location => qr|^\/api\/v1\/acquisitions\/vendors/\d*|, 'SWAGGER3.4.1') > ->json_is( '/name' => $vendor->{name} ) > ->json_is( '/address1' => $vendor->{address1} )->tx->res->json('/id') >-- >2.11.0
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 23858
:
94480
|
94481
|
94482
|
94534
|
94535
|
94536
|
94796
|
94797
| 94798