From bb879d3d053a03461c84ccc7e519b51b18579494 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 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 Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- 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/ILL/Batch/Statuses.pm | 2 +- Koha/REST/V1/ILL/Batches.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 48d311c713..11d0f74a3b 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 9f70260779..2b93fb2875 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 d7ffae91ae..1c614de723 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 2aa72b7c4a..9bc0c5a58b 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 50edcf4555..eca2f602f4 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 d8ec12a309..3abc878860 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 adcef85d7b..d1131904c5 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 223916cb30..0097dd12ea 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 ea97f83461..f6f166137b 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 15ca25a35b..dc282e6f7c 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 3f7a3f6239..44e381ef1b 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 664cc6a8c3..e97d4f6ef6 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 1c62c19b4d..0bde699b88 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 47be08cacb..dd67576d05 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 3da19cac4a..63ca976540 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 5cc107a41d..10c1a9ee8f 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 bc1d9613cd..1bd807aeda 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 157205ac99..39087d418f 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 c7fe918f19..fd8ad547b4 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 e9d43cf8ae..856386e0c1 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 56638f3943..e0d7c5b271 100644 --- a/Koha/REST/V1/Holds.pm +++ b/Koha/REST/V1/Holds.pm @@ -330,10 +330,7 @@ sub delete { $hold->cancel; - return $c->render( - status => 204, - openapi => q{} - ); + return $c->render_resource_deleted; } catch { $c->unhandled_exception($_); @@ -397,7 +394,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/ILL/Batch/Statuses.pm b/Koha/REST/V1/ILL/Batch/Statuses.pm index f4df8f64ae..45612f5f8d 100644 --- a/Koha/REST/V1/ILL/Batch/Statuses.pm +++ b/Koha/REST/V1/ILL/Batch/Statuses.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/ILL/Batches.pm b/Koha/REST/V1/ILL/Batches.pm index d82527a72a..2ca11368c4 100644 --- a/Koha/REST/V1/ILL/Batches.pm +++ b/Koha/REST/V1/ILL/Batches.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 b626148bff..c61b216690 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 8a5a56639f..4d147ed195 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 a1b0624213..1181a2f9bf 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 5599b67c40..16bfca58c3 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 d11998ea48..29a268ac29 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 63bac23577..99b094b7e9 100644 --- a/Koha/REST/V1/Patrons/Holds.pm +++ b/Koha/REST/V1/Patrons/Holds.pm @@ -80,10 +80,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 4a23fae4d8..e85ac7ee69 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 d3df7299a9..fc60e7feec 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 b45bfa96ff..8d89e55a7f 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 cff934d01d..5dcc122975 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 cfa0b4ec44..45d2bceb43 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 db9930c145..47af7e2e24 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 aef48c976f..bf86c2a98d 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 4b3797e9b8..63fe386b64 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 8f625fa9ec..d79f7c68cf 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 96dc59e9c6..d16218d9aa 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.39.5