diff --git a/src/api/interpretation.ts b/src/api/interpretation.ts index ca93c1a3..c498e652 100644 --- a/src/api/interpretation.ts +++ b/src/api/interpretation.ts @@ -1,6 +1,6 @@ import { default as axios } from "axios"; -const handleUploadCredentials = async (credentials: any) => { +export const handleUploadCredentials = async (credentials: any) => { try { await axios.post('http://localhost:8080/integration/upload-credentials', { credentials: JSON.parse(credentials) }); alert('Service Account credentials saved successfully.'); @@ -10,13 +10,13 @@ const handleUploadCredentials = async (credentials: any) => { } }; -const handleWriteToSheet = async (spreadsheetId: any, range: any) => { +export const handleWriteToSheet = async (spreadsheetId: any, range: any) => { try { - await axios.post('http://localhost:8080/integration/write-to-sheet', { spreadsheetId, range }); - alert('Data written to Google Sheet successfully.'); + await axios.post('http://localhost:8080/integration/write-to-sheet', { spreadsheetId, range }); + alert('Data written to Google Sheet successfully.'); } catch (error) { - console.error('Error writing to Google Sheet:', error); - alert('Failed to write to Google Sheet.'); + console.error('Error writing to Google Sheet:', error); + alert('Failed to write to Google Sheet.'); } - }; +};