From 2880eee2e0992dde715a6d629ba358eba808bc78 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi 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 81d84bd1243..4482b5392b5 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 0f53a2a4d1c..576fc7d2575 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 7a840298caf..36008bf23af 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 258a155c6eb..474667590ac 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 ed5b8b00b88..7da80f51af7 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 e6ee64cd557..c5b7eaf4c70 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 a4c142e0270..a85bbdf1205 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 f3b54aaff31..a4d8af8e921 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 26085b385ad..541db585139 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 037eb3fb6e9..da6ebc9f36f 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 5131443a7d5..5849dd075a5 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 2b58e42ff05..ec8ccd3010f 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 d6259802bd9..bbaee8cac66 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 f2048716a59..bb10e8e9094 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 9f6e21f3aca..1a626be2c91 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 07e7fe7c0e6..99a01c8a953 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