From 365ff8f9e18becb0074d38ef01b0fd04310dc379 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 17 Sep 2024 22:38:32 +0530 Subject: [PATCH] feat: handle write to sheet --- src/api/interpretation.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/api/interpretation.ts b/src/api/interpretation.ts index 0215292f..ca93c1a3 100644 --- a/src/api/interpretation.ts +++ b/src/api/interpretation.ts @@ -10,4 +10,13 @@ const handleUploadCredentials = async (credentials: any) => { } }; +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.'); + } catch (error) { + console.error('Error writing to Google Sheet:', error); + alert('Failed to write to Google Sheet.'); + } + };