Type ds in testconfiguration
This commit is contained in:
parent
bb12d2a8cb
commit
122cd843ab
|
@ -78,7 +78,7 @@ class TestConfiguration {
|
||||||
table?: Table
|
table?: Table
|
||||||
linkedTable: any
|
linkedTable: any
|
||||||
automation: any
|
automation: any
|
||||||
datasource: any
|
datasource?: Datasource
|
||||||
tenantId?: string
|
tenantId?: string
|
||||||
defaultUserValues: DefaultUserValues
|
defaultUserValues: DefaultUserValues
|
||||||
api: API
|
api: API
|
||||||
|
@ -528,7 +528,7 @@ class TestConfiguration {
|
||||||
// TABLE
|
// TABLE
|
||||||
|
|
||||||
async updateTable(
|
async updateTable(
|
||||||
config?: any,
|
config?: Table,
|
||||||
{ skipReassigning } = { skipReassigning: false }
|
{ skipReassigning } = { skipReassigning: false }
|
||||||
): Promise<Table> {
|
): Promise<Table> {
|
||||||
config = config || basicTable()
|
config = config || basicTable()
|
||||||
|
@ -543,6 +543,11 @@ class TestConfiguration {
|
||||||
if (config != null && config._id) {
|
if (config != null && config._id) {
|
||||||
delete config._id
|
delete config._id
|
||||||
}
|
}
|
||||||
|
config = config || basicTable()
|
||||||
|
if (this.datasource && !config.sourceId) {
|
||||||
|
config.sourceId = this.datasource._id
|
||||||
|
}
|
||||||
|
|
||||||
return this.updateTable(config, options)
|
return this.updateTable(config, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -678,17 +683,17 @@ class TestConfiguration {
|
||||||
config = config || basicDatasource()
|
config = config || basicDatasource()
|
||||||
const response = await this._req(config, null, controllers.datasource.save)
|
const response = await this._req(config, null, controllers.datasource.save)
|
||||||
this.datasource = response.datasource
|
this.datasource = response.datasource
|
||||||
return this.datasource
|
return this.datasource!
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateDatasource(datasource: any) {
|
async updateDatasource(datasource: Datasource): Promise<Datasource> {
|
||||||
const response = await this._req(
|
const response = await this._req(
|
||||||
datasource,
|
datasource,
|
||||||
{ datasourceId: datasource._id },
|
{ datasourceId: datasource._id },
|
||||||
controllers.datasource.update
|
controllers.datasource.update
|
||||||
)
|
)
|
||||||
this.datasource = response.datasource
|
this.datasource = response.datasource
|
||||||
return this.datasource
|
return this.datasource!
|
||||||
}
|
}
|
||||||
|
|
||||||
async restDatasource(cfg?: any) {
|
async restDatasource(cfg?: any) {
|
||||||
|
@ -772,7 +777,7 @@ class TestConfiguration {
|
||||||
if (!this.datasource && !config) {
|
if (!this.datasource && !config) {
|
||||||
throw "No datasource created for query."
|
throw "No datasource created for query."
|
||||||
}
|
}
|
||||||
config = config || basicQuery(this.datasource._id)
|
config = config || basicQuery(this.datasource!._id!)
|
||||||
return this._req(config, null, controllers.query.save)
|
return this._req(config, null, controllers.query.save)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue