Bugzilla – Attachment 76919 Details for
Bug 20287
Move AddMember and ModMember to Koha::Patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20287: Replace occurrences of AddMember in REST API
Bug-20287-Replace-occurrences-of-AddMember-in-REST.patch (text/plain), 1.37 KB, created by
Jonathan Druart
on 2018-07-12 18:50:31 UTC
(
hide
)
Description:
Bug 20287: Replace occurrences of AddMember in REST API
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-07-12 18:50:31 UTC
Size:
1.37 KB
patch
obsolete
>From 07f713e8a9364a629fdaaa2a7e59ed7339322feb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 29 Mar 2018 12:53:01 -0300 >Subject: [PATCH] Bug 20287: Replace occurrences of AddMember in REST API > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/REST/V1/Patrons.pm | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > >diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm >index 2c1934ab0a..a24a7d50e4 100644 >--- a/Koha/REST/V1/Patrons.pm >+++ b/Koha/REST/V1/Patrons.pm >@@ -19,7 +19,7 @@ use Modern::Perl; > > use Mojo::Base 'Mojolicious::Controller'; > >-use C4::Members qw( AddMember ModMember ); >+use C4::Members qw( ModMember ); > use Koha::Patrons; > > use Scalar::Util qw(blessed); >@@ -126,9 +126,8 @@ sub add { > > my $body = _to_model( $c->validation->param('body') ); > >- # TODO: Use AddMember until it has been moved to Koha-namespace >- my $patron_id = AddMember( %{ _to_model($body) } ); >- my $patron = _to_api( Koha::Patrons->find($patron_id)->TO_JSON ); >+ my $patron = Koha::Patron->new( _to_model($body) )->store; >+ $patron = _to_api( $patron->TO_JSON ); > > return $c->render( status => 201, openapi => $patron ); > } >-- >2.11.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 20287
:
73436
|
76901
|
76902
|
76903
|
76904
|
76905
|
76906
|
76907
|
76908
|
76909
|
76910
|
76911
|
76912
|
76913
|
76914
|
76915
|
76916
|
76917
|
76918
| 76919 |
76920
|
76921
|
76922
|
76923
|
76924
|
76927
|
77221