feat: exports

This commit is contained in:
karishmas6
2024-09-17 22:39:05 +05:30
parent 365ff8f9e1
commit 719093b575

View File

@@ -1,6 +1,6 @@
import { default as axios } from "axios"; import { default as axios } from "axios";
const handleUploadCredentials = async (credentials: any) => { export const handleUploadCredentials = async (credentials: any) => {
try { try {
await axios.post('http://localhost:8080/integration/upload-credentials', { credentials: JSON.parse(credentials) }); await axios.post('http://localhost:8080/integration/upload-credentials', { credentials: JSON.parse(credentials) });
alert('Service Account credentials saved successfully.'); 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 { try {
await axios.post('http://localhost:8080/integration/write-to-sheet', { spreadsheetId, range }); await axios.post('http://localhost:8080/integration/write-to-sheet', { spreadsheetId, range });
alert('Data written to Google Sheet successfully.'); alert('Data written to Google Sheet successfully.');
} catch (error) { } catch (error) {
console.error('Error writing to Google Sheet:', error); console.error('Error writing to Google Sheet:', error);
alert('Failed to write to Google Sheet.'); alert('Failed to write to Google Sheet.');
} }
}; };