Bugzilla – Attachment 164378 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 resource_deleted() helper everywhere
Bug-36495-Use-resourcedeleted-helper-everywhere.patch (text/plain), 23.34 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-04-03 12:59:41 UTC
(
hide
)
Description:
Bug 36495: Use resource_deleted() helper everywhere
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-04-03 12:59:41 UTC
Size:
23.34 KB
patch
obsolete
>From 481a1d60aafbb5b661e1d4006ebeda32bbd3c924 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 resource_deleted() helper everywhere > >This patch makes the API controllers use the 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 +- > t/db_dependent/api/v1/responses.t | 2 +- > 40 files changed, 64 insertions(+), 185 deletions(-) > >diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm >index c4d6f8430cd..678ff5b2c00 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Acquisitions/Vendors.pm b/Koha/REST/V1/Acquisitions/Vendors.pm >index 75935900e18..5d10c6de60b 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/AdvancedEditorMacro.pm b/Koha/REST/V1/AdvancedEditorMacro.pm >index ffba8a88bbd..2633b7f556b 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->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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/ArticleRequests.pm b/Koha/REST/V1/ArticleRequests.pm >index 3996a234ce1..9f47016af02 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->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->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 48a59a326e4..0a50a04ece4 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->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 0dcdf95bbc8..2109e2fa893 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Authorities.pm b/Koha/REST/V1/Authorities.pm >index b172486787d..8f39ae75cdf 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index c46c4f02ca5..d9ddf59b6f8 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->resource_deleted; > } > } > catch { >diff --git a/Koha/REST/V1/Biblios/ItemGroups.pm b/Koha/REST/V1/Biblios/ItemGroups.pm >index 4de16091716..cbe34afb52e 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->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 4e6561377c9..de1521f6dff 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Bookings.pm b/Koha/REST/V1/Bookings.pm >index e6975374f78..914cc7be4a6 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->resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Cities.pm b/Koha/REST/V1/Cities.pm >index ce12f09fb84..73606706052 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->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 9f620d05aac..0ad26f01a2f 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/ERM/Agreements.pm b/Koha/REST/V1/ERM/Agreements.pm >index c75921373a7..53ba3b79e3d 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->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 e42c8961ed5..8158b9bc3a6 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->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 37b030420bd..50b628d107f 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->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 daff3527ed2..34d85ebeeb3 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->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 861ead9d5f0..6aa5c6d7f98 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->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 2326643d30e..7024cee9e96 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->resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/ERM/Licenses.pm b/Koha/REST/V1/ERM/Licenses.pm >index 8cd977e3409..756a21fe4c6 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->resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index f8dde763eb0..02f080307d1 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->resource_deleted; > } > catch { > $c->unhandled_exception($_); >@@ -389,7 +386,7 @@ sub resume { > > return try { > $hold->resume; >- return $c->render( status => 204, openapi => {} ); >+ return $c->resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/IllbatchStatuses.pm b/Koha/REST/V1/IllbatchStatuses.pm >index 7229163bcfe..0ca23d5f7c6 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->resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Illbatches.pm b/Koha/REST/V1/Illbatches.pm >index 9c4f214db5c..feb0eb4fc96 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->resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/ImportBatchProfiles.pm b/Koha/REST/V1/ImportBatchProfiles.pm >index 16b5bd634ab..ba277ad4c9d 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Items.pm b/Koha/REST/V1/Items.pm >index ba8e662e407..1edd236a87b 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->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->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 092d41afe94..7de18d0428f 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->resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm >index fe40b58371d..3c7a4f5f262 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->resource_deleted; > } > ); > } catch { >diff --git a/Koha/REST/V1/Patrons/Attributes.pm b/Koha/REST/V1/Patrons/Attributes.pm >index cc341ee0b68..4e61488c284 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->resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/Patrons/Holds.pm b/Koha/REST/V1/Patrons/Holds.pm >index b5cc32beab6..ac7c558e1df 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->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 d4c9a21b127..bbc60b82a82 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->resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Preservation/Trains.pm b/Koha/REST/V1/Preservation/Trains.pm >index d280945ad05..e634cea0abb 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->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->resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Preservation/WaitingList.pm b/Koha/REST/V1/Preservation/WaitingList.pm >index 4fb937a180d..99d81f2cbf8 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->resource_deleted; > } catch { > $c->unhandled_exception($_); > }; >diff --git a/Koha/REST/V1/Quotes.pm b/Koha/REST/V1/Quotes.pm >index d14abf0335e..9973aa76dd2 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->resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/ReturnClaims.pm b/Koha/REST/V1/ReturnClaims.pm >index 5366e5816fc..5c26012d763 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/SearchFilter.pm b/Koha/REST/V1/SearchFilter.pm >index 1d17ec931ff..ed674b80bb6 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Suggestions.pm b/Koha/REST/V1/Suggestions.pm >index ddb6eb23507..0c26e6b03dc 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/Tickets.pm b/Koha/REST/V1/Tickets.pm >index 908759b1830..4e8f49f7d95 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->resource_deleted; >+ } catch { > $c->unhandled_exception($_); > }; > } >diff --git a/Koha/REST/V1/TransferLimits.pm b/Koha/REST/V1/TransferLimits.pm >index 8f625fa9ece..1b522e9170b 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->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->resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/Koha/REST/V1/TwoFactorAuth.pm b/Koha/REST/V1/TwoFactorAuth.pm >index 96dc59e9c63..b9462551205 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->resource_deleted; > } > catch { > $c->unhandled_exception($_); >diff --git a/t/db_dependent/api/v1/responses.t b/t/db_dependent/api/v1/responses.t >index 5b30757ea84..2ca33c84f9f 100755 >--- a/t/db_dependent/api/v1/responses.t >+++ b/t/db_dependent/api/v1/responses.t >@@ -105,7 +105,7 @@ subtest 'resource_deleted() tests' => sub { > 'delete', > sub { > my $c = shift->openapi->valid_input or return; >- $c->resource_deleted; >+ return $c->resource_deleted; > } > ); > >-- >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