]> git.koha-community.org Git - koha.git/commit
Bug 36480: Add GET /libraries/:library_id/desks
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 1 Apr 2024 20:24:35 +0000 (20:24 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 24 May 2024 08:11:25 +0000 (10:11 +0200)
commite27cb37de7f062439fa54ce1b1aca9405dc9747f
tree7b602edd73f2b05abdcb21243322d21abb96ad49
parent0cf193f7399e452ed29a9924b46494c575df7dd4
Bug 36480: Add GET /libraries/:library_id/desks

This patch adds the mentioned endpoint. For it, it does:

* Add Koha::Desk->to_api_mapping
* Add desk.yaml with the correct data structure for desks
* Add the route to the spec
* Add tests

Note: Lucas and I had doubts about the right return value for when the feature is disabled.
I opted for returning 404 with a message telling the feature is disabled. This can be discussed.

To test:
1. Apply this patches
2. Run:
   $ ktd
  k$ qa
=> SUCCESS: All green, all tests pass!
3. Play with this using Postman.
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit afd83c134e2ef4759d0512f713d4f4911f0190f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Desk.pm
Koha/REST/V1/Libraries.pm
api/v1/swagger/definitions/desk.yaml [new file with mode: 0644]
api/v1/swagger/paths/libraries.yaml
api/v1/swagger/swagger.yaml
t/db_dependent/api/v1/libraries.t