feat: send selected google sheet id

This commit is contained in:
karishmas6
2024-10-17 19:57:09 +05:30
parent 21098c7571
commit 2aa9cfccf1

View File

@@ -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);