View | Details | Raw Unified | Return to bug 23858
Collapse All | Expand All

(-)a/Koha/REST/V1/Acquisitions/Vendors.pm (-1 / +1 lines)
Lines 103-109 sub add_vendor { Link Here
103
        $vendor->store;
103
        $vendor->store;
104
        $c->res->headers->location($c->req->url->to_string . '/' . $vendor->id );
104
        $c->res->headers->location($c->req->url->to_string . '/' . $vendor->id );
105
        return $c->render(
105
        return $c->render(
106
            status  => 200,
106
            status  => 201,
107
            openapi => $vendor->to_api
107
            openapi => $vendor->to_api
108
        );
108
        );
109
    }
109
    }
(-)a/api/v1/swagger/paths/acquisitions_vendors.json (-1 / +1 lines)
Lines 84-90 Link Here
84
        "application/json"
84
        "application/json"
85
      ],
85
      ],
86
      "responses": {
86
      "responses": {
87
        "200": {
87
        "201": {
88
          "description": "Vendor added",
88
          "description": "Vendor added",
89
          "schema": {
89
          "schema": {
90
            "$ref": "../definitions.json#/vendor"
90
            "$ref": "../definitions.json#/vendor"
(-)a/t/db_dependent/api/v1/acquisitions_vendors.t (-2 / +1 lines)
Lines 222-228 subtest 'add() tests' => sub { Link Here
222
    $tx->req->cookies( { name => 'CGISESSID', value => $authorized_session_id } );
222
    $tx->req->cookies( { name => 'CGISESSID', value => $authorized_session_id } );
223
    $tx->req->env( { REMOTE_ADDR => $remote_address } );
223
    $tx->req->env( { REMOTE_ADDR => $remote_address } );
224
    my $vendor_id = $t->request_ok($tx)
224
    my $vendor_id = $t->request_ok($tx)
225
                      ->status_is(200)
225
                      ->status_is( 201, 'SWAGGER3 .2.1' )
226
                      ->header_like( Location => qr|^\/api\/v1\/acquisitions\/vendors/\d*|, 'SWAGGER3.4.1')
226
                      ->header_like( Location => qr|^\/api\/v1\/acquisitions\/vendors/\d*|, 'SWAGGER3.4.1')
227
                      ->json_is( '/name' => $vendor->{name} )
227
                      ->json_is( '/name' => $vendor->{name} )
228
                      ->json_is( '/address1' => $vendor->{address1} )->tx->res->json('/id')
228
                      ->json_is( '/address1' => $vendor->{address1} )->tx->res->json('/id')
229
- 

Return to bug 23858