From 8c900e7f289e85ef21041637326942855ec74964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Mon, 5 Aug 2024 15:04:23 +0200 Subject: [PATCH] Fix FLEXIAPI-202 Add account parameter to the redirection in the destroy admin route --- CHANGELOG.md | 1 + .../app/Http/Controllers/Admin/AccountDeviceController.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a9f4b0..624eb37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ v1.6 (master) v1.5 --- +- Fix FLEXIAPI-202 Add account parameter to the redirection in the destroy admin route - Fix FLEXIAPI-195 Fix LiblinphoneTesterAccoutSeeder to fit with the latest Account related changes - Fix FLEXIAPI-193 Typo - Fix FLEXIAPI-192 Clear and upgrade properly the account dictionary entries if the entries are already existing diff --git a/flexiapi/app/Http/Controllers/Admin/AccountDeviceController.php b/flexiapi/app/Http/Controllers/Admin/AccountDeviceController.php index 2b96e13..2952c3f 100644 --- a/flexiapi/app/Http/Controllers/Admin/AccountDeviceController.php +++ b/flexiapi/app/Http/Controllers/Admin/AccountDeviceController.php @@ -58,8 +58,10 @@ class AccountDeviceController extends Controller public function destroy(Request $request, int $accountId) { $connector = new FlexisipConnector; - $connector->deleteDevice(Account::findOrFail($accountId)->identifier, $request->get('uuid')); + $account = Account::findOrFail($accountId); - return redirect()->route('admin.account.device.index'); + $connector->deleteDevice($account->identifier, $request->get('uuid')); + + return redirect()->route('admin.account.device.index', $account); } }