Bug 27352

Summary: Add GET /biblios/:biblio_id/items
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: REST APIAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, jonathan.druart, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Circulation function:
Bug Depends on: 27034    
Bug Blocks: 27358    
Attachments: Bug 27352: Add GET /biblios/:biblio_id/items
Bug 27352: Unit tests
Bug 27352: Missed case in bug 25032
Bug 27352: Add GET /biblios/:biblio_id/items
Bug 27352: Unit tests
Bug 27352: Missed case in bug 25032
Bug 27352: Add GET /biblios/:biblio_id/items
Bug 27352: Unit tests
Bug 27352: Missed case in bug 25032

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