From eaa8e80efadc55d42462af0a5381f2552acc3c88 Mon Sep 17 00:00:00 2001
From: Vijay Aravamudhan <vraravam@users.noreply.github.com>
Date: Sat, 27 May 2023 18:48:38 +0530
Subject: Expose "Clear service cache" in the service settings screen and the
 sidebar context menu for individual services (#1053)

---
 src/containers/settings/EditServiceScreen.tsx | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'src/containers/settings/EditServiceScreen.tsx')

diff --git a/src/containers/settings/EditServiceScreen.tsx b/src/containers/settings/EditServiceScreen.tsx
index 0a079c608..3b9d3ee43 100644
--- a/src/containers/settings/EditServiceScreen.tsx
+++ b/src/containers/settings/EditServiceScreen.tsx
@@ -468,6 +468,16 @@ class EditServiceScreen extends Component<IProps> {
     }
   }
 
+  clearCache(): void {
+    const { action } = this.props.params;
+
+    if (action === 'edit') {
+      const { clearCache } = this.props.actions.service;
+      const { activeSettings: service } = this.props.stores.services;
+      clearCache({ serviceId: service?.id });
+    }
+  }
+
   openRecipeFile(file: any): void {
     const { openRecipeFile } = this.props.actions.service;
     const { action } = this.props.params;
@@ -534,6 +544,7 @@ class EditServiceScreen extends Component<IProps> {
           isDeleting={services.deleteServiceRequest.isExecuting}
           onSubmit={d => this.onSubmit(d)}
           onDelete={() => this.deleteService()}
+          onClearCache={() => this.clearCache()}
           openRecipeFile={file => this.openRecipeFile(file)}
           isProxyFeatureEnabled={proxyFeature.isEnabled}
         />
-- 
cgit v1.2.3-54-g00ecf

