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:
parent
359780886e
commit
14e5e175fc
4 changed files with 33 additions and 0 deletions
|
@ -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
|
||||
|
|
15
api/v1/swagger/definitions/vendor_alias.yaml
Normal file
15
api/v1/swagger/definitions/vendor_alias.yaml
Normal 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
|
|
@ -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
|
||||
|
|
|
@ -12,6 +12,9 @@ export class AcquisitionAPIClient extends HttpClient {
|
|||
getAll: (query) =>
|
||||
this.get({
|
||||
endpoint: "vendors?" + (query || "_per_page=-1"),
|
||||
headers: {
|
||||
"x-koha-embed": "aliases",
|
||||
},
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue