Bugzilla – Attachment 164384 Details for
Bug 36495
Add render_resource_not_found() and render_resource_deleted() helpers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36495: Use render_resource_deleted() helper everywhere
Bug-36495-Use-renderresourcedeleted-helper-everywh.patch (text/plain), 23.16 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-04-03 15:41:13 UTC
(
hide
)
Description:
Bug 36495: Use render_resource_deleted() helper everywhere
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-04-03 15:41:13 UTC
Size:
23.16 KB
patch
obsolete
>From 9995b5e3b19be90767bebdfe96da6ff21f33db95 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 2 Apr 2024 19:11:49 +0000 >Subject: [PATCH] Bug 36495: Use render_resource_deleted() helper everywhere > >This patch makes the API controllers use the render_resource_deleted() helper. > >No behavior changes are expected. > >To test: >1. Apply this patch >2. Run: > $ ktd --shell > k$ prove t/db_dependent/api/v1 >=> SUCCESS: Nothing broke >3. Sign off :-D >--- > Koha/REST/V1/Acquisitions/Orders.pm | 10 ++-------- > Koha/REST/V1/Acquisitions/Vendors.pm | 9 ++------- > Koha/REST/V1/AdvancedEditorMacro.pm | 10 ++++------ > Koha/REST/V1/ArticleRequests.pm | 13 +++---------- > Koha/REST/V1/Auth/Identity/Provider/Domains.pm | 5 +---- > Koha/REST/V1/Auth/Identity/Providers.pm | 8 ++------ > Koha/REST/V1/Authorities.pm | 5 ++--- > Koha/REST/V1/Biblios.pm | 2 +- > Koha/REST/V1/Biblios/ItemGroups.pm | 5 ++--- > Koha/REST/V1/Biblios/ItemGroups/Items.pm | 8 ++------ > Koha/REST/V1/Bookings.pm | 5 +---- > Koha/REST/V1/Cities.pm | 5 +---- > Koha/REST/V1/Config/SMTP/Servers.pm | 9 ++------- > Koha/REST/V1/ERM/Agreements.pm | 8 ++------ > Koha/REST/V1/ERM/EHoldings/Packages/Local.pm | 8 ++------ > Koha/REST/V1/ERM/EHoldings/Titles/Local.pm | 8 ++------ > Koha/REST/V1/ERM/EUsage/CounterFiles.pm | 5 +---- > Koha/REST/V1/ERM/EUsage/DefaultUsageReports.pm | 5 +---- > Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm | 5 +---- > Koha/REST/V1/ERM/Licenses.pm | 5 +---- > Koha/REST/V1/Holds.pm | 7 ++----- > Koha/REST/V1/IllbatchStatuses.pm | 2 +- > Koha/REST/V1/Illbatches.pm | 2 +- > Koha/REST/V1/ImportBatchProfiles.pm | 9 ++------- > Koha/REST/V1/Items.pm | 11 ++--------- > Koha/REST/V1/Libraries.pm | 2 +- > Koha/REST/V1/Patrons.pm | 5 +---- > Koha/REST/V1/Patrons/Attributes.pm | 5 +---- > Koha/REST/V1/Patrons/Holds.pm | 5 +---- > Koha/REST/V1/Preservation/Processings.pm | 5 +---- > Koha/REST/V1/Preservation/Trains.pm | 11 ++--------- > Koha/REST/V1/Preservation/WaitingList.pm | 5 +---- > Koha/REST/V1/Quotes.pm | 5 +---- > Koha/REST/V1/ReturnClaims.pm | 8 ++------ > Koha/REST/V1/SearchFilter.pm | 5 ++--- > Koha/REST/V1/Suggestions.pm | 8 ++------ > Koha/REST/V1/Tickets.pm | 8 ++------ > Koha/REST/V1/TransferLimits.pm | 4 ++-- > Koha/REST/V1/TwoFactorAuth.pm | 2 +- > 39 files changed, 63 insertions(+), 184 deletions(-) > >diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm >index 48d311c713f..11d0f74a3b3 100644 >--- a/Koha/REST/V1/Acquisitions/Orders.pm >+++ b/Koha/REST/V1/Acquisitions/Orders.pm >@@ -197,15 +197,9 @@ sub delete { > } > > return try { >- > $order->delete; >- >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Acquisitions/Vendors.pm b/Koha/REST/V1/Acquisitions/Vendors.pm >index 9f70260779a..2b93fb28751 100644 >--- a/Koha/REST/V1/Acquisitions/Vendors.pm >+++ b/Koha/REST/V1/Acquisitions/Vendors.pm >@@ -146,13 +146,8 @@ sub delete { > unless $vendor; > > $vendor->delete; >- >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/AdvancedEditorMacro.pm b/Koha/REST/V1/AdvancedEditorMacro.pm >index d7ffae91aef..1c614de723e 100644 >--- a/Koha/REST/V1/AdvancedEditorMacro.pm >+++ b/Koha/REST/V1/AdvancedEditorMacro.pm >@@ -264,9 +264,8 @@ sub delete { > > return try { > $macro->delete; >- return $c->render( status => 204, openapi => q{} ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >@@ -292,9 +291,8 @@ sub delete_shared { > > return try { > $macro->delete; >- return $c->render( status => 204, openapi => q{} ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/ArticleRequests.pm b/Koha/REST/V1/ArticleRequests.pm >index 2aa72b7c4af..9bc0c5a58b1 100644 >--- a/Koha/REST/V1/ArticleRequests.pm >+++ b/Koha/REST/V1/ArticleRequests.pm >@@ -58,10 +58,7 @@ sub cancel { > notes => $notes > } > ); >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >@@ -99,12 +96,8 @@ sub patron_cancel { > notes => $notes > } > ); >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Auth/Identity/Provider/Domains.pm b/Koha/REST/V1/Auth/Identity/Provider/Domains.pm >index 50edcf4555d..eca2f602f4c 100644 >--- a/Koha/REST/V1/Auth/Identity/Provider/Domains.pm >+++ b/Koha/REST/V1/Auth/Identity/Provider/Domains.pm >@@ -186,10 +186,7 @@ sub delete { > > return try { > $domain->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Auth/Identity/Providers.pm b/Koha/REST/V1/Auth/Identity/Providers.pm >index d8ec12a309f..3abc878860b 100644 >--- a/Koha/REST/V1/Auth/Identity/Providers.pm >+++ b/Koha/REST/V1/Auth/Identity/Providers.pm >@@ -202,12 +202,8 @@ sub delete { > > return try { > $provider->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Authorities.pm b/Koha/REST/V1/Authorities.pm >index adcef85d7b7..d1131904c5a 100644 >--- a/Koha/REST/V1/Authorities.pm >+++ b/Koha/REST/V1/Authorities.pm >@@ -112,9 +112,8 @@ sub delete { > return try { > DelAuthority( { authid => $authority->authid } ); > >- return $c->render( status => 204, openapi => q{} ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index a4ed3955ea4..a2ba6baf203 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -135,7 +135,7 @@ sub delete { > ); > } > else { >- return $c->render( status => 204, openapi => "" ); >+ return $c->render_resource_deleted; > } > } > catch { >diff --git a/Koha/REST/V1/Biblios/ItemGroups.pm b/Koha/REST/V1/Biblios/ItemGroups.pm >index ea97f834616..f6f166137b9 100644 >--- a/Koha/REST/V1/Biblios/ItemGroups.pm >+++ b/Koha/REST/V1/Biblios/ItemGroups.pm >@@ -211,9 +211,8 @@ sub delete { > > return try { > $item_group->delete; >- return $c->render( status => 204, openapi => '' ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Biblios/ItemGroups/Items.pm b/Koha/REST/V1/Biblios/ItemGroups/Items.pm >index 15ca25a35bd..dc282e6f7c1 100644 >--- a/Koha/REST/V1/Biblios/ItemGroups/Items.pm >+++ b/Koha/REST/V1/Biblios/ItemGroups/Items.pm >@@ -136,12 +136,8 @@ sub delete { > > return try { > $item_link->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Bookings.pm b/Koha/REST/V1/Bookings.pm >index 3f7a3f6239f..44e381ef1b9 100644 >--- a/Koha/REST/V1/Bookings.pm >+++ b/Koha/REST/V1/Bookings.pm >@@ -140,10 +140,7 @@ sub delete { > > return try { > $booking->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Cities.pm b/Koha/REST/V1/Cities.pm >index 664cc6a8c3a..e97d4f6ef6c 100644 >--- a/Koha/REST/V1/Cities.pm >+++ b/Koha/REST/V1/Cities.pm >@@ -119,10 +119,7 @@ sub delete { > > return try { > $city->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/Config/SMTP/Servers.pm b/Koha/REST/V1/Config/SMTP/Servers.pm >index 1c62c19b4d1..0bde699b882 100644 >--- a/Koha/REST/V1/Config/SMTP/Servers.pm >+++ b/Koha/REST/V1/Config/SMTP/Servers.pm >@@ -164,13 +164,8 @@ sub delete { > > return try { > $smtp_server->delete; >- >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/ERM/Agreements.pm b/Koha/REST/V1/ERM/Agreements.pm >index 47be08cacba..dd67576d053 100644 >--- a/Koha/REST/V1/ERM/Agreements.pm >+++ b/Koha/REST/V1/ERM/Agreements.pm >@@ -247,12 +247,8 @@ sub delete { > > return try { > $agreement->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/ERM/EHoldings/Packages/Local.pm b/Koha/REST/V1/ERM/EHoldings/Packages/Local.pm >index 3da19cac4a5..63ca9765407 100644 >--- a/Koha/REST/V1/ERM/EHoldings/Packages/Local.pm >+++ b/Koha/REST/V1/ERM/EHoldings/Packages/Local.pm >@@ -220,12 +220,8 @@ sub delete { > > return try { > $package->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm b/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm >index 5cc107a41d7..10c1a9ee8f7 100644 >--- a/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm >+++ b/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm >@@ -216,12 +216,8 @@ sub delete { > > return try { > $title->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/ERM/EUsage/CounterFiles.pm b/Koha/REST/V1/ERM/EUsage/CounterFiles.pm >index bc1d9613cd0..1bd807aeda0 100644 >--- a/Koha/REST/V1/ERM/EUsage/CounterFiles.pm >+++ b/Koha/REST/V1/ERM/EUsage/CounterFiles.pm >@@ -85,10 +85,7 @@ sub delete { > > return try { > $counter_file->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/ERM/EUsage/DefaultUsageReports.pm b/Koha/REST/V1/ERM/EUsage/DefaultUsageReports.pm >index 157205ac997..39087d418f4 100644 >--- a/Koha/REST/V1/ERM/EUsage/DefaultUsageReports.pm >+++ b/Koha/REST/V1/ERM/EUsage/DefaultUsageReports.pm >@@ -119,10 +119,7 @@ sub delete { > > return try { > $default_report->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm b/Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm >index c7fe918f190..fd8ad547b42 100644 >--- a/Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm >+++ b/Koha/REST/V1/ERM/EUsage/UsageDataProviders.pm >@@ -263,10 +263,7 @@ sub delete { > > return try { > $usage_data_provider->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/ERM/Licenses.pm b/Koha/REST/V1/ERM/Licenses.pm >index e9d43cf8ae1..856386e0c10 100644 >--- a/Koha/REST/V1/ERM/Licenses.pm >+++ b/Koha/REST/V1/ERM/Licenses.pm >@@ -228,10 +228,7 @@ sub delete { > > return try { > $license->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index 1cdc2b3d33d..8714747f37d 100644 >--- a/Koha/REST/V1/Holds.pm >+++ b/Koha/REST/V1/Holds.pm >@@ -322,10 +322,7 @@ sub delete { > > $hold->cancel; > >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >@@ -389,7 +386,7 @@ sub resume { > > return try { > $hold->resume; >- return $c->render( status => 204, openapi => {} ); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/IllbatchStatuses.pm b/Koha/REST/V1/IllbatchStatuses.pm >index 4afcb34af42..70ad3608b18 100644 >--- a/Koha/REST/V1/IllbatchStatuses.pm >+++ b/Koha/REST/V1/IllbatchStatuses.pm >@@ -148,7 +148,7 @@ sub delete { > > return try { > $status->delete_and_log; >- return $c->render( status => 204, openapi => '' ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Illbatches.pm b/Koha/REST/V1/Illbatches.pm >index e9eedfb84a3..485134bec9b 100644 >--- a/Koha/REST/V1/Illbatches.pm >+++ b/Koha/REST/V1/Illbatches.pm >@@ -165,7 +165,7 @@ sub delete { > > return try { > $batch->delete_and_log; >- return $c->render( status => 204, openapi => '' ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/ImportBatchProfiles.pm b/Koha/REST/V1/ImportBatchProfiles.pm >index b626148bff1..c61b2166909 100644 >--- a/Koha/REST/V1/ImportBatchProfiles.pm >+++ b/Koha/REST/V1/ImportBatchProfiles.pm >@@ -121,13 +121,8 @@ sub delete { > > return try { > $profile->delete; >- >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Items.pm b/Koha/REST/V1/Items.pm >index 8a5a56639f2..4d147ed1953 100644 >--- a/Koha/REST/V1/Items.pm >+++ b/Koha/REST/V1/Items.pm >@@ -158,11 +158,7 @@ sub delete { > } > > $item->safe_delete; >- >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >@@ -421,10 +417,7 @@ sub remove_from_bundle { > > return try { > $bundle_item->remove_from_bundle; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > if ( ref($_) eq 'Koha::Exceptions::Item::Bundle::BundleIsCheckedOut' ) { > return $c->render( >diff --git a/Koha/REST/V1/Libraries.pm b/Koha/REST/V1/Libraries.pm >index a1b0624213d..1181a2f9bf1 100644 >--- a/Koha/REST/V1/Libraries.pm >+++ b/Koha/REST/V1/Libraries.pm >@@ -152,7 +152,7 @@ sub delete { > > return try { > $library->delete; >- return $c->render( status => 204, openapi => ''); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm >index 5599b67c40e..16bfca58c3d 100644 >--- a/Koha/REST/V1/Patrons.pm >+++ b/Koha/REST/V1/Patrons.pm >@@ -414,10 +414,7 @@ sub delete { > $patron->move_to_deleted; > $patron->delete; > >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } > ); > } catch { >diff --git a/Koha/REST/V1/Patrons/Attributes.pm b/Koha/REST/V1/Patrons/Attributes.pm >index d11998ea485..29a268ac29c 100644 >--- a/Koha/REST/V1/Patrons/Attributes.pm >+++ b/Koha/REST/V1/Patrons/Attributes.pm >@@ -285,10 +285,7 @@ sub delete { > unless $attribute; > > $attribute->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/Patrons/Holds.pm b/Koha/REST/V1/Patrons/Holds.pm >index b3fa4cb1329..46084efa13d 100644 >--- a/Koha/REST/V1/Patrons/Holds.pm >+++ b/Koha/REST/V1/Patrons/Holds.pm >@@ -78,10 +78,7 @@ sub delete_public { > > if ( $hold->is_cancelable_from_opac ) { > $hold->cancel; >- return $c->render( >- status => 204, >- openapi => q{}, >- ); >+ return $c->render_resource_deleted; > } elsif ( $hold->is_waiting and $hold->cancellation_requestable_from_opac ) { > $hold->add_cancellation_request; > return $c->render( >diff --git a/Koha/REST/V1/Preservation/Processings.pm b/Koha/REST/V1/Preservation/Processings.pm >index 4a23fae4d8d..e85ac7ee69a 100644 >--- a/Koha/REST/V1/Preservation/Processings.pm >+++ b/Koha/REST/V1/Preservation/Processings.pm >@@ -208,10 +208,7 @@ sub delete { > } > return try { > $processing->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Preservation/Trains.pm b/Koha/REST/V1/Preservation/Trains.pm >index d3df7299a91..fc60e7feecb 100644 >--- a/Koha/REST/V1/Preservation/Trains.pm >+++ b/Koha/REST/V1/Preservation/Trains.pm >@@ -200,10 +200,7 @@ sub delete { > > return try { > $train->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >@@ -509,11 +506,7 @@ sub remove_item { > > return try { > $train_item->delete; >- >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Preservation/WaitingList.pm b/Koha/REST/V1/Preservation/WaitingList.pm >index b45bfa96ff2..8d89e55a7f6 100644 >--- a/Koha/REST/V1/Preservation/WaitingList.pm >+++ b/Koha/REST/V1/Preservation/WaitingList.pm >@@ -145,10 +145,7 @@ sub remove_item { > > $item->notforloan(0)->store; > >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Quotes.pm b/Koha/REST/V1/Quotes.pm >index cff934d01dd..5dcc1229750 100644 >--- a/Koha/REST/V1/Quotes.pm >+++ b/Koha/REST/V1/Quotes.pm >@@ -121,10 +121,7 @@ sub delete { > > return try { > $quote->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/ReturnClaims.pm b/Koha/REST/V1/ReturnClaims.pm >index cfa0b4ec44c..45d2bceb437 100644 >--- a/Koha/REST/V1/ReturnClaims.pm >+++ b/Koha/REST/V1/ReturnClaims.pm >@@ -192,12 +192,8 @@ sub delete_claim { > > $claim->delete(); > >- return $c->render( >- status => 204, >- openapi => {} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/SearchFilter.pm b/Koha/REST/V1/SearchFilter.pm >index db9930c145f..47af7e2e24a 100644 >--- a/Koha/REST/V1/SearchFilter.pm >+++ b/Koha/REST/V1/SearchFilter.pm >@@ -135,9 +135,8 @@ sub delete { > > return try { > $filter->delete; >- return $c->render( status => 204, openapi => q{} ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Suggestions.pm b/Koha/REST/V1/Suggestions.pm >index aef48c976f1..bf86c2a98df 100644 >--- a/Koha/REST/V1/Suggestions.pm >+++ b/Koha/REST/V1/Suggestions.pm >@@ -201,12 +201,8 @@ sub delete { > > return try { > $suggestion->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Tickets.pm b/Koha/REST/V1/Tickets.pm >index 4b3797e9b80..63fe386b648 100644 >--- a/Koha/REST/V1/Tickets.pm >+++ b/Koha/REST/V1/Tickets.pm >@@ -132,12 +132,8 @@ sub delete { > > return try { > $ticket->delete; >- return $c->render( >- status => 204, >- openapi => q{} >- ); >- } >- catch { >+ return $c->render_resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/TransferLimits.pm b/Koha/REST/V1/TransferLimits.pm >index 8f625fa9ece..d79f7c68cfe 100644 >--- a/Koha/REST/V1/TransferLimits.pm >+++ b/Koha/REST/V1/TransferLimits.pm >@@ -109,7 +109,7 @@ sub delete { > > return try { > $transfer_limit->delete; >- return $c->render( status => 204, openapi => ''); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >@@ -217,7 +217,7 @@ sub batch_delete { > > Koha::Item::Transfer::Limits->search($search_params)->delete; > >- return $c->render( status => 204, openapi => q{} ); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/TwoFactorAuth.pm b/Koha/REST/V1/TwoFactorAuth.pm >index 96dc59e9c63..d16218d9aa8 100644 >--- a/Koha/REST/V1/TwoFactorAuth.pm >+++ b/Koha/REST/V1/TwoFactorAuth.pm >@@ -173,7 +173,7 @@ sub verification { > ); > } > >- return $c->render(status => 204, openapi => {}); >+ return $c->render_resource_deleted; > } > catch { > $c->unhandled_exception($_); >-- >2.44.0
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 36495
:
164291
|
164297
|
164301
|
164377
|
164378
|
164380
|
164382
|
164383
|
164384
|
164971
|
164972
|
164973
|
164983
|
164984
|
164985
|
165696