From ca1107539c98e132c3295661176021750ffe762b Mon Sep 17 00:00:00 2001 From: Steve <34465153+xxl4@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:19:13 +0800 Subject: [PATCH] fix add skipcache for api --- src/Http/Controllers/Api/V1/Admin/ResourceController.php | 2 +- .../Controllers/Api/V1/Admin/Settings/LocaleController.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Http/Controllers/Api/V1/Admin/ResourceController.php b/src/Http/Controllers/Api/V1/Admin/ResourceController.php index c9fafcc..64a7be7 100644 --- a/src/Http/Controllers/Api/V1/Admin/ResourceController.php +++ b/src/Http/Controllers/Api/V1/Admin/ResourceController.php @@ -26,7 +26,7 @@ class ResourceController extends V1Controller implements ResourceContract * * @var array */ - protected $requestException = ['page', 'limit', 'pagination', 'sort', 'order', 'token']; + protected $requestException = ['page', 'limit', 'pagination', 'sort', 'order', 'token','skipCache']; /** * Returns a listing of the resource. diff --git a/src/Http/Controllers/Api/V1/Admin/Settings/LocaleController.php b/src/Http/Controllers/Api/V1/Admin/Settings/LocaleController.php index 1b3a52c..22ff7ce 100644 --- a/src/Http/Controllers/Api/V1/Admin/Settings/LocaleController.php +++ b/src/Http/Controllers/Api/V1/Admin/Settings/LocaleController.php @@ -97,6 +97,9 @@ public function destroy(int $id) } Event::dispatch('core.locale.delete.before', $id); + // clean the locale repository cache + + $this->getRepositoryInstance()->delete($id); Event::dispatch('core.locale.delete.after', $id);