Bug 36100: Remove readOnly from bookings definition.
Whilst readOnly feels correct here, swagger doesn't work that way at our version. It must be removed to restore the ability to edit exising bookings. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
4515581eff
commit
e8a2f4df73
|
|
@ -83,7 +83,7 @@ sub add {
|
|||
$c->res->headers->location( $c->req->url->to_string . '/' . $booking->booking_id );
|
||||
return $c->render(
|
||||
status => 201,
|
||||
openapi => $c->objects->to_api( $booking ),
|
||||
openapi => $c->objects->to_api($booking),
|
||||
);
|
||||
} catch {
|
||||
if ( blessed $_ and $_->isa('Koha::Exceptions::Booking::Clash') ) {
|
||||
|
|
@ -91,6 +91,13 @@ sub add {
|
|||
status => 400,
|
||||
openapi => { error => "Booking would conflict" }
|
||||
);
|
||||
} elsif ( blessed $_ and $_->isa('Koha::Exceptions::Object::DuplicateID') ) {
|
||||
return $c->render(
|
||||
status => 400,
|
||||
openapi => {
|
||||
error => "Duplicate booking_id",
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return $c->unhandled_exception($_);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ properties:
|
|||
booking_id:
|
||||
description: Internal booking identifier
|
||||
type: integer
|
||||
readOnly: true
|
||||
end_date:
|
||||
description: Start date and time of this booking
|
||||
format: date-time
|
||||
|
|
|
|||
Loading…
Reference in New Issue