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

--- Comment #1 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 200612
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200612&action=edit
Bug 42869: Return 202 Accepted for ERM async job endpoints

The ERM import endpoints (import_from_list, import_from_kbart_file)
enqueue background jobs but incorrectly returned 201 Created. This
patch changes them to return 202 Accepted with a Location header
pointing to the job tracking endpoint, per HTTP semantics for async
operations.

Changes:
- import_from_list returns 202 with Location: /api/v1/jobs/{job_id}
- import_from_kbart_file returns 202 with Location: /api/v1/jobs/{job_id}
- OpenAPI spec updated to document 202 responses and Location header
- API test updated to assert 202 and Location header
- Cypress mock updated to use 202

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/erm_eholdings_titles.t
=> SUCCESS: Tests pass!
3. Run Cypress tests:
  k$ yarn cypress run --spec t/cypress/integration/ERM/Titles_spec.ts
=> SUCCESS: Tests pass!
4. Sign off :-D

-- 
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