Fix FLEXIAPI-363 Send the Redis publish event when the externalAccount is...

This commit is contained in:
Timothée Jaussoin 2025-07-23 13:25:32 +00:00
parent 8882cdab18
commit 0578125f70
4 changed files with 15 additions and 7 deletions

View file

@ -68,6 +68,7 @@ v2.0
- Fix FLEXIAPI-360 Add rules on some jobs to only run them in the Gitlab pipeline when needed
- Fix FLEXIAPI-362 Return an empty object and not an empty array in the vcards-storage index endpoint to prevent some parsing issues in the clients
- Fix FLEXIAPI-312 Add Redis publish event when updating the externalAccount to ping the Flexisip B2BUA
- Fix FLEXIAPI-363 Send the Redis publish event when the externalAccount is deleted to ping the Flexisip B2BUA
v1.6
----

View file

@ -50,17 +50,14 @@ class ExternalAccountController extends Controller
public function delete(int $accountId)
{
$account = Account::findOrFail($accountId);
return view('admin.account.external.delete', [
'account' => $account
'account' => Account::findOrFail($accountId)
]);
}
public function destroy(int $accountId)
{
$account = Account::findOrFail($accountId);
$account->external->delete();
(new AccountService)->deleteExternalAccount($accountId);
return redirect()->route('admin.account.show', $account->id);
}

View file

@ -42,7 +42,6 @@ class ExternalAccountController extends Controller
public function destroy(int $accountId)
{
$account = Account::findOrFail($accountId);
return $account->external->delete();
return (new AccountService)->deleteExternalAccount($accountId);
}
}

View file

@ -457,4 +457,15 @@ class AccountService
return $externalAccount;
}
public function deleteExternalAccount(int $accountId)
{
$account = Account::findOrFail($accountId);
$externalAccount = $account->external;
if ($externalAccount) {
(new FlexisipRedisConnector)->pingB2BUA($externalAccount);
return $externalAccount->delete();
}
}
}