1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

Update types

This commit is contained in:
Adria Navarro 2023-05-16 11:44:58 +02:00
parent a21039d5b4
commit 911a072069

View file

@ -1,5 +1,5 @@
import {
DatasourceFeature,
ConnectionInfo,
DatasourceFieldType,
DatasourcePlus,
FieldType,
@ -141,13 +141,16 @@ class GoogleSheetsIntegration implements DatasourcePlus {
this.client = new GoogleSpreadsheet(spreadsheetId)
}
async testConnection() {
async testConnection(): Promise<ConnectionInfo> {
try {
await this.connect()
await this.client.loadInfo()
return true
return { connected: true }
} catch (e: any) {
return { error: e.message as string }
return {
connected: false,
error: e.message as string,
}
}
}