Bugzilla – Attachment 162229 Details for
Bug 36100
Regression in bookings edit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36100: Remove readOnly from bookings definition.
Bug-36100-Remove-readOnly-from-bookings-definition.patch (text/plain), 2.03 KB, created by
David Nind
on 2024-02-15 22:50:55 UTC
(
hide
)
Description:
Bug 36100: Remove readOnly from bookings definition.
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-02-15 22:50:55 UTC
Size:
2.03 KB
patch
obsolete
>From df695a02642dd1b15898325f09d282e4a20ad093 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 15 Feb 2024 10:15:12 +0000 >Subject: [PATCH] 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> >--- > Koha/REST/V1/Bookings.pm | 9 ++++++++- > api/v1/swagger/definitions/booking.yaml | 1 - > 2 files changed, 8 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/Bookings.pm b/Koha/REST/V1/Bookings.pm >index f4e15013ef..0e355f23dd 100644 >--- a/Koha/REST/V1/Bookings.pm >+++ b/Koha/REST/V1/Bookings.pm >@@ -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($_); >diff --git a/api/v1/swagger/definitions/booking.yaml b/api/v1/swagger/definitions/booking.yaml >index a615bb9ed8..23393a60ff 100644 >--- a/api/v1/swagger/definitions/booking.yaml >+++ b/api/v1/swagger/definitions/booking.yaml >@@ -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 >-- >2.30.2
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 36100
:
162192
|
162202
|
162203
|
162229
|
162230
|
162633
|
162634
|
162635
|
162636
|
162637
|
162638