diff --git a/src/components/molecules/IntegrationSettings.tsx b/src/components/molecules/IntegrationSettings.tsx index 0a472397..2a8fce8b 100644 --- a/src/components/molecules/IntegrationSettings.tsx +++ b/src/components/molecules/IntegrationSettings.tsx @@ -62,19 +62,18 @@ export const IntegrationSettingsModal = ({ isOpen, handleStart, handleClose }: I }; // Function to send the selected sheet ID to the backend to update the robot's google_sheet_id -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); - } -}; - + 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); + } + }; // Handle spreadsheet selection const handleSpreadsheetSelect = (e: React.ChangeEvent) => { @@ -129,9 +128,9 @@ const updateGoogleSheetId = async () => { {/* Show user info and allow spreadsheet selection once authenticated */} {userInfo && ( <> - - Logged in as: {userInfo.email} - + + Logged in as: {userInfo.email} + )} @@ -158,8 +157,8 @@ const updateGoogleSheetId = async () => { + Fetch Google Spreadsheets + {/* Display selected spreadsheet name */} {settings.spreadsheetId && (