Bug 23858: (follow-up) Return code fix
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> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
8ac459777b
commit
618d8a690e
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
"application/json"
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"201": {
|
||||
"description": "Vendor added",
|
||||
"schema": {
|
||||
"$ref": "../definitions.json#/vendor"
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in New Issue