]> 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)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 26 Apr 2024 16:06:10 +0000 (18:06 +0200)
commitafd83c134e2ef4759d0512f713d4f4911f0190f0
tree91252f09837eba21dffdae62e234b393ccdc60bf
parent7f7f486d94e52eb50d070ccead61c94928aeff28
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>
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