Bugzilla – Attachment 162635 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: (QA follow-up) Move 400 to 409
Bug-36100-QA-follow-up-Move-400-to-409.patch (text/plain), 2.10 KB, created by
Marcel de Rooy
on 2024-03-01 07:59:53 UTC
(
hide
)
Description:
Bug 36100: (QA follow-up) Move 400 to 409
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-03-01 07:59:53 UTC
Size:
2.10 KB
patch
obsolete
>From 68ec10c1ae65f1ce7dfe261975f262f0259cfc8b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 1 Mar 2024 07:58:00 +0000 >Subject: [PATCH] Bug 36100: (QA follow-up) Move 400 to 409 >Content-Type: text/plain; charset=utf-8 > >Duplicate exceptions tend to generate a 409 in our REST API. >--- > Koha/REST/V1/Bookings.pm | 2 +- > api/v1/swagger/paths/bookings.yaml | 4 ++++ > t/db_dependent/api/v1/bookings.t | 2 +- > 3 files changed, 6 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/Bookings.pm b/Koha/REST/V1/Bookings.pm >index 0e355f23dd..2d1bb25ad8 100644 >--- a/Koha/REST/V1/Bookings.pm >+++ b/Koha/REST/V1/Bookings.pm >@@ -93,7 +93,7 @@ sub add { > ); > } elsif ( blessed $_ and $_->isa('Koha::Exceptions::Object::DuplicateID') ) { > return $c->render( >- status => 400, >+ status => 409, > openapi => { > error => "Duplicate booking_id", > } >diff --git a/api/v1/swagger/paths/bookings.yaml b/api/v1/swagger/paths/bookings.yaml >index f1dcb9f9be..f7bb0b8804 100644 >--- a/api/v1/swagger/paths/bookings.yaml >+++ b/api/v1/swagger/paths/bookings.yaml >@@ -102,6 +102,10 @@ > description: Access forbidden > schema: > $ref: ../swagger.yaml#/definitions/error >+ 409: >+ description: Conflict >+ schema: >+ $ref: ../swagger.yaml#/definitions/error > 500: > description: Internal error > schema: >diff --git a/t/db_dependent/api/v1/bookings.t b/t/db_dependent/api/v1/bookings.t >index 14a4396f46..8ede614153 100755 >--- a/t/db_dependent/api/v1/bookings.t >+++ b/t/db_dependent/api/v1/bookings.t >@@ -262,7 +262,7 @@ subtest 'add() tests' => sub { > > # Authorized attempt to create with existing id > $booking->{booking_id} = $booking_id; >- $t->post_ok( "//$userid:$password@/api/v1/bookings" => json => $booking )->status_is(400) >+ $t->post_ok( "//$userid:$password@/api/v1/bookings" => json => $booking )->status_is(409) > ->json_is( "/error" => "Duplicate booking_id" ); > > # TODO: Test bookings clashes >-- >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