Fix FLEXIAPI-183 Complete the account hooks on the dictionnary actions

This commit is contained in:
Timothée Jaussoin 2024-06-10 16:48:28 +02:00
parent 0d399503c4
commit 880f0cbc74
3 changed files with 20 additions and 1 deletions

View file

@ -2,6 +2,7 @@
v1.5
----
- Fix FLEXIAPI-183 Complete the account hooks on the dictionnary actions
- Fix FLEXIAPI-181 Replace APP_ADMINS_MANAGE_MULTI_DOMAINS with APP_SUPER_ADMINS_SIP_DOMAINS
- Fix FLEXIAPI-180 Fix the token and activation flow for the provisioning with token endpoint when the header is missing
- Fix FLEXIAPI-179 Add Localization support as a Middleware that handles Accept-Language HTTP header

View file

@ -56,6 +56,11 @@ class AccountDictionaryController extends Controller
$account->setDictionaryEntry($request->get('key'), $request->get('value'));
if (function_exists('accountServiceAccountEditedHook')) {
$account->refresh();
accountServiceAccountEditedHook($request, $account);
}
return redirect()->route('admin.account.dictionary.index', $account->id);
}
@ -81,6 +86,11 @@ class AccountDictionaryController extends Controller
$entry->value = $request->get('value');
$entry->save();
if (function_exists('accountServiceAccountEditedHook')) {
$account->refresh();
accountServiceAccountEditedHook($request, $account);
}
return redirect()->route('admin.account.dictionary.index', $account->id);
}

View file

@ -42,7 +42,15 @@ class AccountDictionaryController extends Controller
'value' => 'required'
]);
return Account::findOrFail($accountId)->setDictionaryEntry($key, $request->get('value'));
$account = Account::findOrFail($accountId);
$result = $account->setDictionaryEntry($key, $request->get('value'));
if (function_exists('accountServiceAccountEditedHook')) {
$account->refresh();
accountServiceAccountEditedHook($request, $account);
}
return $result;
}
public function destroy(int $accountId, string $key)