Bug 33103: Embed aliases in GET /vendors

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-03-01 12:43:44 +01:00 committed by Tomas Cohen Arazi
parent 359780886e
commit 14e5e175fc
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
4 changed files with 33 additions and 0 deletions

View file

@ -114,6 +114,11 @@ properties:
- string
- "null"
description: External id
aliases:
type: array
description: List of aliases
items:
$ref: "vendor_alias.yaml"
additionalProperties: false
required:
- name

View file

@ -0,0 +1,15 @@
---
type: object
properties:
alias_id:
description: Internal ID for the extended attribute
type: integer
vendor_id:
description: ID of the vendor
type: integer
alias:
description: The alias
type: string
additionalProperties: false
required:
- alias

View file

@ -27,6 +27,16 @@
- $ref: "../swagger.yaml#/parameters/q_body"
- $ref: "../swagger.yaml#/parameters/q_header"
- $ref: "../swagger.yaml#/parameters/request_id_header"
- name: x-koha-embed
in: header
required: false
description: Embed list sent as a request header
type: array
items:
type: string
enum:
- aliases
collectionFormat: csv
responses:
"200":
description: A list of vendors

View file

@ -12,6 +12,9 @@ export class AcquisitionAPIClient extends HttpClient {
getAll: (query) =>
this.get({
endpoint: "vendors?" + (query || "_per_page=-1"),
headers: {
"x-koha-embed": "aliases",
},
}),
};
}