Lines 108-113
sub add {
Link Here
|
108 |
|
108 |
|
109 |
my $extended_attributes = delete $body->{extended_attributes} // []; |
109 |
my $extended_attributes = delete $body->{extended_attributes} // []; |
110 |
|
110 |
|
|
|
111 |
my $confirm_not_duplicate = $c->req->headers->header('x-confirm-not-duplicate'); |
112 |
if ( !$confirm_not_duplicate ) { |
113 |
my $match_result = |
114 |
Koha::Patrons->check_for_existing_matches( Koha::Patron->new_from_api($body)->unblessed ); |
115 |
if ( $match_result->{duplicate_found} ) { |
116 |
return $c->render( |
117 |
status => 409, |
118 |
openapi => { error => 'A patron record matching these details already exists' } |
119 |
); |
120 |
} |
121 |
} |
122 |
|
111 |
my $patron = Koha::Patron->new_from_api($body)->store; |
123 |
my $patron = Koha::Patron->new_from_api($body)->store; |
112 |
|
124 |
|
113 |
my $overrides = $c->stash('koha.overrides'); |
125 |
my $overrides = $c->stash('koha.overrides'); |