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

            Bug ID: 42753
           Summary: item-api-client.js: items.get() should accept headers
                    parameter instead of hardcoding x-koha-embed
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: REST API
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]

ItemAPIClient.items.get(id) hardcodes x-koha-embed: '+strings' in the
request headers. This should be passed through from the caller (like
getAll already does) so different consumers can request different embeds.

Current:
  get: id => this.httpClient.get({
      endpoint: 'items/' + id,
      headers: { 'x-koha-embed': '+strings' },
  }),

Should be:
  get: (id, params = {}) => this.httpClient.get({
      endpoint: 'items/' + id,
      ...params,
  }),

Callers that need +strings would pass it explicitly:
  APIClient.item.items.get(id, { headers: { 'x-koha-embed': '+strings' } })

This follows the same pass-through pattern used for bundled_items.add().

-- 
You are receiving this mail because:
You are the assignee for the bug.
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