From 2aa9cfccf1e3592d4920cf380f32866f2d3c3137 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Thu, 17 Oct 2024 19:57:09 +0530 Subject: [PATCH] feat: send selected google sheet id --- src/components/molecules/IntegrationSettings.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/components/molecules/IntegrationSettings.tsx b/src/components/molecules/IntegrationSettings.tsx index 0dad7650..73cc6f7e 100644 --- a/src/components/molecules/IntegrationSettings.tsx +++ b/src/components/molecules/IntegrationSettings.tsx @@ -62,6 +62,19 @@ export const IntegrationSettingsModal = ({ isOpen, handleStart, handleClose }: I } }; + const updateGoogleSheetId = async () => { + try { + const response = await axios.post( + `http://localhost:8080/auth/gsheets/update`, + { spreadsheetId: settings.spreadsheetId, robotId: recordingId }, + { withCredentials: true } + ); + console.log('Google Sheet ID updated:', response.data); + } catch (error: any) { + console.error('Error updating Google Sheet ID:', error.response?.data?.message || error.message); + } + }; + useEffect(() => { // Check if we're on the callback URL const urlParams = new URLSearchParams(window.location.search);