Bug 27544 - Simplify /checkouts implementation
Summary: Simplify /checkouts implementation
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 17005
Blocks: 27353
  Show dependency treegraph
 
Reported: 2021-01-25 13:32 UTC by Tomás Cohen Arazi
Modified: 2022-06-06 20:24 UTC (History)
3 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


Attachments
Bug 27544: Simplilfy GET /checkouts implementation (2.96 KB, patch)
2021-01-25 13:41 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 27544: Simplilfy GET /checkouts implementation (3.03 KB, patch)
2021-01-25 13:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27544: Simplify GET /checkouts implementation (3.03 KB, patch)
2021-01-25 14:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27544: Simplify GET /checkouts implementation (3.09 KB, patch)
2021-01-25 14:57 UTC, Martin Renvoize
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 2021-01-25 13:32:19 UTC
Because of the 'checked_in' parameter, the list() method got too complex. It should be just using $c->objects->search instead, after cleaning that param from the validated parameters list.
Comment 1 Tomás Cohen Arazi 2021-01-25 13:41:36 UTC
Created attachment 115770 [details] [review]
Bug 27544: Simplilfy GET /checkouts implementation

This patch makes the list() controller method simpler, by removing the
checked_in parameter, and passing the appropriate restulset.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/checkouts.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass! (no behaviour change)
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Jonathan Druart 2021-01-25 13:54:39 UTC
Created attachment 115772 [details] [review]
Bug 27544: Simplilfy GET /checkouts implementation

This patch makes the list() controller method simpler, by removing the
checked_in parameter, and passing the appropriate restulset.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/checkouts.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass! (no behaviour change)
4. Sign off :-D

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Jonathan Druart 2021-01-25 14:00:25 UTC
Created attachment 115773 [details] [review]
Bug 27544: Simplify GET /checkouts implementation

This patch makes the list() controller method simpler, by removing the
checked_in parameter, and passing the appropriate restulset.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/checkouts.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass! (no behaviour change)
4. Sign off :-D

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Martin Renvoize 2021-01-25 14:57:38 UTC
Created attachment 115778 [details] [review]
Bug 27544: Simplify GET /checkouts implementation

This patch makes the list() controller method simpler, by removing the
checked_in parameter, and passing the appropriate restulset.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/checkouts.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass! (no behaviour change)
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2021-01-25 14:58:06 UTC
Nice cleanup, works as expected.. Passing QA
Comment 6 Jonathan Druart 2021-01-28 16:35:04 UTC
Pushed to master for 21.05, thanks to everybody involved!