Update types

This commit is contained in:
Adria Navarro 2023-05-16 11:44:58 +02:00
parent a21039d5b4
commit 911a072069
1 changed files with 7 additions and 4 deletions

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,
}
}
}