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

--- Comment #13 from David Nind <[email protected]> ---
Created attachment 212437
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212437&action=edit
Bug 33711: (follow-up) Use snake_case error codes on POST /checkouts

The staff POST /checkouts route contract changes on this bug, and it
still returned the uppercase error codes from bug 23336, and no
error_code when AddIssue fails.

This patch renames them, as the API coding guidelines require:
- MISSING_OR_WRONG_PARAMETERS => item_id_or_external_id_required
- ITEM_ID_NOT_MATCHING_EXTERNAL_ID => item_id_not_matching_external_id
- the 500 returned when AddIssue fails carries internal_server_error

The public route (POST /public/patrons/{patron_id}/checkouts) keeps its
codes, as it is left unchanged on this bug.

Test plan:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ yarn api:bundle
  k$ restart_all
  k$ prove t/db_dependent/api/v1/checkouts.t \
           xt/api.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Assisted-by: Opus 5.5 (Anthropic)
Signed-off-by: David Nind <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
You are on the CC list for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to