[Koha-bugs] [Bug 35797] REST API: Add GET route for patronimage

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 12 18:44:26 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35797

--- Comment #1 from Shi Yao Wang <shi-yao.wang at inLibro.com> ---
Created attachment 160993
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160993&action=edit
Bug 35797: REST API Add GET route for patronimage

Api changes adding GET route for patronimage

Test plan:
1- Apply the patch
2- Go to administration -> sys.pref. -> set patronimages to allow
3- Log in koha using a user with edit_borrowers privileges
4- Have a patron with a profile image (add an image if necessary by
searching for a patron and then clicking on the default profile image on
the top left)
5- Open a new browser tab, write
{intranet_url}/api/v1/patrons/{borrowernumber}/image
where {intranet_url} is the base intranet url of koha and {borrowernumber}
is the borrowernumber of a borrower that has an image
6- Notice the response is a json with 3 keys: imagefile, mimetype and
patron_id which corresponds to the fields of patronimage table in the
database. Note that imagefile in db and in json response are different
because it has been base64 encoded in order to be sent as a string in json
7- Do step 5 with a borrowernumber of a patron without an image and a
borrowernumber of a patron that doesn't exist (and other edge cases
where there should be an error message displayed such as "Access
forbidden", "Authentication required", etc.)
8- Notice an appropriate error message is displayed

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list