Bug 23860: Make the patrons endpoint add the Location header

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Tomas Cohen Arazi 2019-10-21 16:21:16 -03:00 committed by Martin Renvoize
parent e1179b27e0
commit abf530ddbf
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 5 additions and 1 deletions

View File

@ -127,7 +127,11 @@ sub add {
my $patron = Koha::Patron->new( _to_model($body) )->store;
return $c->render( status => 201, openapi => $patron->to_api );
$c->res->headers->location( $c->req->url->to_string . '/' . $patron->borrowernumber );
return $c->render(
status => 201,
openapi => $patron->to_api
);
}
catch {
unless ( blessed $_ && $_->can('rethrow') ) {