Bug 27352 - Add GET /biblios/:biblio_id/items
Summary: Add GET /biblios/:biblio_id/items
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact:
URL:
Keywords:
Depends on: 27034
Blocks: 27358
  Show dependency treegraph
 
Reported: 2021-01-06 14:39 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2022-06-06 20:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Circulation function:


Attachments
Bug 27352: Add GET /biblios/:biblio_id/items (5.19 KB, patch)
2021-01-06 15:03 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 27352: Unit tests (2.02 KB, patch)
2021-01-06 16:12 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 27352: Missed case in bug 25032 (785 bytes, patch)
2021-01-06 16:12 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 27352: Add GET /biblios/:biblio_id/items (5.25 KB, patch)
2021-01-08 23:41 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 27352: Unit tests (2.08 KB, patch)
2021-01-08 23:41 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 27352: Missed case in bug 25032 (841 bytes, patch)
2021-01-08 23:41 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 27352: Add GET /biblios/:biblio_id/items (5.30 KB, patch)
2021-01-26 12:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 27352: Unit tests (2.14 KB, patch)
2021-01-26 12:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 27352: Missed case in bug 25032 (906 bytes, patch)
2021-01-26 12:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2021-01-06 14:39:34 UTC
It would be helpful to have that route.
Comment 1 Tomás Cohen Arazi (tcohen) 2021-01-06 15:03:44 UTC
Created attachment 114892 [details] [review]
Bug 27352: Add GET /biblios/:biblio_id/items

This patch adds a route to fetch the items for a biblio. It relies
entirely on already existing methods.

To test:
1. Use your favourite REST tool
2. Play with the new route.
=> SUCCESS: It works as expected!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi (tcohen) 2021-01-06 16:12:26 UTC
Created attachment 114894 [details] [review]
Bug 27352: Unit tests
Comment 3 Tomás Cohen Arazi (tcohen) 2021-01-06 16:12:30 UTC
Created attachment 114895 [details] [review]
Bug 27352: Missed case in bug 25032

Probably because of the order things got pushed.
Comment 4 Lucas Gass (lukeg) 2021-01-08 23:41:13 UTC
Created attachment 114983 [details] [review]
Bug 27352: Add GET /biblios/:biblio_id/items

This patch adds a route to fetch the items for a biblio. It relies
entirely on already existing methods.

To test:
1. Use your favourite REST tool
2. Play with the new route.
=> SUCCESS: It works as expected!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Lucas Gass (lukeg) 2021-01-08 23:41:18 UTC
Created attachment 114984 [details] [review]
Bug 27352: Unit tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 6 Lucas Gass (lukeg) 2021-01-08 23:41:22 UTC
Created attachment 114985 [details] [review]
Bug 27352: Missed case in bug 25032

Probably because of the order things got pushed.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Lucas Gass (lukeg) 2021-01-08 23:43:25 UTC
Works good with PostMan. I also play around with stuff like:

let url = '/api/v1/biblios/144/items';
      $.getJSON(url, function(data) {
   			data.forEach(element => console.log(element.collection_code));
}); 


Just to see how it works. I really like this route. 


Also tests pass for me: prove -v t/db_dependent/api/v1/biblios.t
Comment 8 Martin Renvoize (ashimema) 2021-01-26 12:52:06 UTC
Created attachment 115810 [details] [review]
Bug 27352: Add GET /biblios/:biblio_id/items

This patch adds a route to fetch the items for a biblio. It relies
entirely on already existing methods.

To test:
1. Use your favourite REST tool
2. Play with the new route.
=> SUCCESS: It works as expected!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2021-01-26 12:52:09 UTC
Created attachment 115811 [details] [review]
Bug 27352: Unit tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2021-01-26 12:52:12 UTC
Created attachment 115812 [details] [review]
Bug 27352: Missed case in bug 25032

Probably because of the order things got pushed.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize (ashimema) 2021-01-26 12:53:22 UTC
It's great to see these routes getting added.. Thanks for all your diligent work Tomas!

Works great, all makes sense and passes QA scripts and Unit tests.

Passing QA
Comment 12 Jonathan Druart 2021-01-29 08:00:01 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 13 Fridolin Somers 2021-02-05 15:34:30 UTC
Depends on Bug 27034 not in 20.11.x