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

(-)a/api/v1/swagger/paths/acquisitions_vendors.yaml (+1 lines)
Lines 151-156 Link Here
151
            - aliases
151
            - aliases
152
            - baskets+count
152
            - baskets+count
153
            - subscriptions+count
153
            - subscriptions+count
154
            - invoices+count
154
            - interfaces
155
            - interfaces
155
            - contacts
156
            - contacts
156
            - contracts
157
            - contracts
(-)a/koha-tmpl/intranet-tmpl/prog/js/fetch/acquisition-api-client.js (-1 / +1 lines)
Lines 21-27 export class AcquisitionAPIClient { Link Here
21
                    endpoint: "vendors/" + id,
21
                    endpoint: "vendors/" + id,
22
                    headers: {
22
                    headers: {
23
                        "x-koha-embed":
23
                        "x-koha-embed":
24
                            "aliases,subscriptions+count,interfaces,contacts,contracts,baskets+count",
24
                            "aliases,subscriptions+count,interfaces,contacts,contracts,baskets+count,invoices+count",
25
                    },
25
                    },
26
                }),
26
                }),
27
            getAll: (query, params) =>
27
            getAll: (query, params) =>
(-)a/t/db_dependent/api/v1/acquisitions_vendors.t (-2 / +7 lines)
Lines 124-130 subtest 'list() and delete() tests | authorized user' => sub { Link Here
124
124
125
subtest 'get() test' => sub {
125
subtest 'get() test' => sub {
126
126
127
    plan tests => 9;
127
    plan tests => 14;
128
128
129
    $schema->storage->txn_begin;
129
    $schema->storage->txn_begin;
130
130
Lines 146-151 subtest 'get() test' => sub { Link Here
146
    $t->get_ok( "//$userid:$password@/api/v1/acquisitions/vendors/" . $vendor->id )->status_is(200)
146
    $t->get_ok( "//$userid:$password@/api/v1/acquisitions/vendors/" . $vendor->id )->status_is(200)
147
        ->json_is( $vendor->to_api );
147
        ->json_is( $vendor->to_api );
148
148
149
    $t->get_ok( "//$userid:$password@/api/v1/acquisitions/vendors/"
150
            . $vendor->id => { 'x-koha-embed' => 'subscriptions+count,baskets+count,invoices+count' } )->status_is(200)
151
        ->json_has( '/subscriptions_count', 'subscriptions_count is embedded' )
152
        ->json_has( '/baskets_count',       'baskets_count is embedded' )
153
        ->json_has( '/invoices_count',      'invoices_count is embedded' );
154
149
    $t->get_ok( "//$userid:$password@/api/v1/acquisitions/vendors/" . $non_existent_id )->status_is(404)
155
    $t->get_ok( "//$userid:$password@/api/v1/acquisitions/vendors/" . $non_existent_id )->status_is(404)
150
        ->json_is( '/error' => 'Vendor not found' );
156
        ->json_is( '/error' => 'Vendor not found' );
151
157
152
- 

Return to bug 38010