https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42732
--- Comment #5 from Jonathan Druart <[email protected]> --- Created attachment 200636 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200636&action=edit Bug 42732: Migrate catalogue/detail.tt addToBundle $.post to api-client.js Replace direct $.post() to /api/v1/items/{id}/bundled_items with ItemAPIClient.bundled_items.add(), which uses http-client.js and automatically includes the CSRF token header. The caller passes return_response: true because it needs access to the raw response status code and body for fine-grained error handling (different user-facing messages for 409/already_bundled, 409/checked_out, 409/reserved, 404/not_found, 400/failed_nesting). http-client.js default behavior throws a plain Error on non-2xx responses, losing the status code and error_code fields the UI needs. Signed-off-by: Tomás Cohen Arazi <[email protected]> Signed-off-by: Jonathan Druart <[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/
