Bugzilla – Attachment 122176 Details for
Bug 28588
Add Koha::Checkouts::ReturnClaim->resolve
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28588: (follow-up) Make the API use the new method
Bug-28588-follow-up-Make-the-API-use-the-new-metho.patch (text/plain), 2.02 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-06-18 19:39:09 UTC
(
hide
)
Description:
Bug 28588: (follow-up) Make the API use the new method
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-06-18 19:39:09 UTC
Size:
2.02 KB
patch
obsolete
>From 736956b522443a853ba7859bdf342184c3c8a385 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 18 Jun 2021 16:34:00 -0300 >Subject: [PATCH] Bug 28588: (follow-up) Make the API use the new method > >This patch adapts the controller method for resolving a return claim so >it uses the Koha::Checkouts::ReturnClaim method instead. > >To test: >1. Run: > $ kshell > k$ prove t/db_dependent/api/v1/return_claims.t >=> SUCCESS: Tests pass! >2. Apply this patch >3. Repeat 1 >=> SUCCESS: Tests pass! >4. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/ReturnClaims.pm | 22 +++++++--------------- > 1 file changed, 7 insertions(+), 15 deletions(-) > >diff --git a/Koha/REST/V1/ReturnClaims.pm b/Koha/REST/V1/ReturnClaims.pm >index bcc210902a..c9fa833387 100644 >--- a/Koha/REST/V1/ReturnClaims.pm >+++ b/Koha/REST/V1/ReturnClaims.pm >@@ -152,10 +152,8 @@ sub resolve_claim { > my $claim = Koha::Checkouts::ReturnClaims->find($claim_id); > > return $c->render( >- status => 404, >- openapi => { >- error => "Claim not found" >- } >+ status => 404, >+ openapi => { error => "Claim not found" } > ) unless $claim; > > return try { >@@ -167,19 +165,13 @@ sub resolve_claim { > my $user = $c->stash('koha.user'); > $resolved_by //= $user->borrowernumber; > >- $claim->set( >+ $claim->resolve( > { >- resolution => $resolution, >- resolved_by => $resolved_by, >- resolved_on => \'NOW()', >- updated_by => $resolved_by, >+ resolution => $resolution, >+ resolved_by => $resolved_by, >+ new_lost_status => $new_lost_status, > } >- )->store; >- >- if ( defined $new_lost_status ) { >- $claim->checkout->item->itemlost($new_lost_status)->store; >- } >- $claim->discard_changes; >+ )->discard_changes; > > return $c->render( > status => 200, >-- >2.32.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28588
:
122174
|
122175
|
122176
|
122179
|
122180
|
122181
|
122219
|
122220
|
122221