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

--- Comment #1 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 199836
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199836&action=edit
Bug 42753: Add embed parameter support to HttpClient

HttpClient now recognizes an 'embed' parameter in request options.
When provided (as an array or string), it is automatically translated
into the 'x-koha-embed' HTTP header.

This centralizes embed handling so individual API clients don't need
to build headers manually. Callers express intent declaratively:

  APIClient.item.items.get(id, { embed: ['+strings', 'biblio'] })

The embed header is built by _buildHeaders() which is called by all
HTTP methods (get, getAll, post, put, patch, delete). Explicit
headers passed via params.headers take precedence over embed-generated
ones.

Also updates ItemAPIClient.items.get() to accept params (including
embed) instead of hardcoding x-koha-embed: '+strings'. Callers that
need +strings now pass it explicitly.

Test plan:
1. Apply patch
2. Verify preservation module still works (uses item_types via getAll)
3. Verify ILL supplying resource still fetches items
4. Sign off :-D

Signed-off-by: Tomás Cohen Arazi <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to