From 196b810a179d0c9f48944f1b94b6b8b424d005e1 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 21 Oct 2024 02:27:45 +0530 Subject: [PATCH] wip: remove integration --- .../molecules/IntegrationSettings.tsx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/components/molecules/IntegrationSettings.tsx b/src/components/molecules/IntegrationSettings.tsx index b1e87347..b3317a2f 100644 --- a/src/components/molecules/IntegrationSettings.tsx +++ b/src/components/molecules/IntegrationSettings.tsx @@ -77,6 +77,26 @@ export const IntegrationSettingsModal = ({ isOpen, handleStart, handleClose }: I } }; + const removeIntegration = async () => { + try { + await axios.post( + `http://localhost:8080/auth/gsheets/remove`, + { robotId: recordingId }, + { withCredentials: true } + ); + + setRecording((prev: any) => ({ + ...prev, + google_sheet_id: null, + google_sheet_name: null, + google_sheet_email: null, + })); + setSettings({ spreadsheetId: '', spreadsheetName: '', data: '' }); + } catch (error: any) { + console.error('Error removing Google Sheets integration:', error.response?.data?.message || error.message); + } + }; + useEffect(() => { // Check if we're on the callback URL const urlParams = new URLSearchParams(window.location.search);