From d9180269a6ea53f1b1aa2c3f45cad13d5ec1d53e Mon Sep 17 00:00:00 2001 From: Jonathan Druart 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 Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- 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.39.5