Bug 35744 - Implement +strings for GET /patrons/:patron_id
Summary: Implement +strings for GET /patrons/:patron_id
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks: 35745
  Show dependency treegraph
 
Reported: 2024-01-09 13:50 UTC by Jonathan Druart
Modified: 2024-02-01 14:42 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.03


Attachments
Bug 35744: Implement +strings for GET /patrons/:patron_id (4.04 KB, patch)
2024-01-09 14:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35744: Implement +strings for GET /patrons/:patron_id (4.09 KB, patch)
2024-01-09 16:53 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 35744: Implement +strings for GET /patrons/:patron_id (4.16 KB, patch)
2024-01-17 10:42 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 Jonathan Druart 2024-01-09 13:50:36 UTC
It would be helpful to have the library's name and patron category's description.
Comment 1 Jonathan Druart 2024-01-09 14:08:55 UTC
Created attachment 160696 [details] [review]
Bug 35744: Implement +strings for GET /patrons/:patron_id

In order to retrieve the library's name and patron category's description alongwith other patron's info.

Test plan:
Run the following command before and after this patch:
% curl -u koha:koha --request GET 'http://localhost:8081/api/v1/patrons/42' --header "Content-Type: application/json" --header "x-koha-embed: +strings" | jq

Notice that you now have _strings which contains the library's name and
patron category's description
Comment 2 Owen Leonard 2024-01-09 16:53:31 UTC
Created attachment 160712 [details] [review]
Bug 35744: Implement +strings for GET /patrons/:patron_id

In order to retrieve the library's name and patron category's
description alongwith other patron's info.

Test plan:
Run the following command before and after this patch:

% curl -u koha:koha --request GET 'http://localhost:8081/api/v1/patrons/42' --header "Content-Type: application/json" --header "x-koha-embed: +strings" | jq

Notice that you now have _strings which contains the library's name and
patron category's description

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Martin Renvoize 2024-01-17 10:42:47 UTC
Created attachment 161088 [details] [review]
Bug 35744: Implement +strings for GET /patrons/:patron_id

In order to retrieve the library's name and patron category's
description alongwith other patron's info.

Test plan:
Run the following command before and after this patch:

% curl -u koha:koha --request GET 'http://localhost:8081/api/v1/patrons/42' --header "Content-Type: application/json" --header "x-koha-embed: +strings" | jq

Notice that you now have _strings which contains the library's name and
patron category's description

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2024-01-17 10:44:51 UTC
The code works, is tested and passed QA (after I did a small tidy on the new code section added).

I'm passing QA.. but...

What pushed you toward the choice of using +strings here vs just an embed?  Whilst it does reduce a small amount of data down the line, the db queries will be the same I believe.. so I'm not sure what the decision making process was?
Comment 5 Jonathan Druart 2024-01-22 20:10:02 UTC
(In reply to Martin Renvoize from comment #4)
> What pushed you toward the choice of using +strings here vs just an embed? 
> Whilst it does reduce a small amount of data down the line, the db queries
> will be the same I believe.. so I'm not sure what the decision making
> process was?

I had to pick one of the two options and choose this one :)
Comment 6 Katrin Fischer 2024-01-29 11:29:07 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 7 Fridolin Somers 2024-02-01 14:42:12 UTC
Pushed to 23.11.x for 23.11.03