Bugzilla – Attachment 122181 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.07 KB, created by
David Nind
on 2021-06-18 20:16:25 UTC
(
hide
)
Description:
Bug 28588: (follow-up) Make the API use the new method
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-06-18 20:16:25 UTC
Size:
2.07 KB
patch
obsolete
>From adf2a73b62a38f5aa648d674c07ef9011194370f 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> > >Signed-off-by: David Nind <david@davidnind.com> >--- > 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.20.1
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