diff --git a/src/api/interpretation.ts b/src/api/interpretation.ts index 85843c64..7e2e3f39 100644 --- a/src/api/interpretation.ts +++ b/src/api/interpretation.ts @@ -13,4 +13,21 @@ export const handleUploadCredentials = async (fileName: any, credentials: any, s console.error('Error uploading credentials:', error); return false; } +}; + +export const handleWriteToGsheet = async (fileName: string, runId: string): Promise<{ + success: boolean; + message: string; + }> => { + try { + const response = await axios.post(`http://localhost:8080/integration/update-google-sheet/${fileName}/${runId}`); + if (response.status === 200) { + return response.data; + } else { + throw new Error(`Couldn't make gsheet integration for ${fileName}`); + } + } catch (error) { + console.error('Error uploading credentials:', error); + return { success: false, message: 'Failed to write to Google Sheet' }; + } }; \ No newline at end of file