From abb5a4c4d8793d4971a7da1d493ed2cfe873d9ec Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 13 Feb 2026 16:12:29 +0530 Subject: [PATCH] feat: add clearDataInCache method to CacheEnabledApiClient --- app/javascript/dashboard/api/CacheEnabledApiClient.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/javascript/dashboard/api/CacheEnabledApiClient.js b/app/javascript/dashboard/api/CacheEnabledApiClient.js index 9af939c00..cf61436f1 100644 --- a/app/javascript/dashboard/api/CacheEnabledApiClient.js +++ b/app/javascript/dashboard/api/CacheEnabledApiClient.js @@ -84,6 +84,15 @@ class CacheEnabledApiClient extends ApiClient { return response; } + async clearDataInCache() { + try { + await this.dataManager.initDb(); + this.dataManager.db.clear(this.cacheModelName); + } catch { + // Ignore error + } + } + async validateCacheKey(cacheKeyFromApi) { if (!this.dataManager.db) { await this.dataManager.initDb();