Fix/elastic search delete (#9492)
* Make sure json param isn't included in delete * lint
This commit is contained in:
parent
f6c7b05ea3
commit
7ce31d64cb
|
@ -80,11 +80,11 @@ const SCHEMA: Integration = {
|
||||||
delete: {
|
delete: {
|
||||||
type: QueryType.FIELDS,
|
type: QueryType.FIELDS,
|
||||||
fields: {
|
fields: {
|
||||||
index: {
|
id: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
id: {
|
index: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
@ -164,9 +164,13 @@ class ElasticSearchIntegration implements IntegrationBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete(query: object) {
|
async delete(query: { id: string; index: string }) {
|
||||||
|
const { id, index } = query
|
||||||
try {
|
try {
|
||||||
const result = await this.client.delete(query)
|
const result = await this.client.delete({
|
||||||
|
id,
|
||||||
|
index,
|
||||||
|
})
|
||||||
return result.body
|
return result.body
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error deleting from elasticsearch", err)
|
console.error("Error deleting from elasticsearch", err)
|
||||||
|
|
Loading…
Reference in New Issue