https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #124 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209784 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209784&action=edit Bug 42383: (QA follow-up) Use the API client to resolve return claims The 'Resolve return claim' modal of the check-in page called PUT /api/v1/return_claims/{claim_id}/resolve with a raw fetch() and emitted 'resolved' whatever the response was. Failures (e.g. a missing permission or a claim deleted in the meantime) were silently reported as success and the modal closed. This patch (QA comment point 15) adds a return_claims.resolve() method to ClaimAPIClient, built on HttpClient.put() like the other API clients, and uses it from the modal through APIClient. 'resolved' is only emitted when the request succeeds; otherwise the error is displayed in the modal, which stays open. Test plan: 1. Set ClaimReturnedLostValue to a lost value 2. Check an item out to a patron and, from the patron's checkouts table, mark it as 'Claim returned' 3. Check the item in on the check-in page 4. Click 'Resolve' on the row, pick a resolution and click 'Resolve claim' => SUCCESS: The claim is resolved 5. Repeat steps 2 to 3, open the resolve modal and, before submitting it, delete the claim from the patron's 'Claims' tab in another browser tab. Submit the modal => FAIL: The modal closes as if the claim had been resolved 6. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 7. Repeat steps 2 to 4 => SUCCESS: The claim is resolved and the modal closes 8. Repeat step 5 => SUCCESS: The modal stays open and displays the error returned by the API 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.