1
0
Fork 0
mirror of synced 2024-08-18 19:41:30 +12:00

Fix/elastic search delete (#9492)

* Make sure json param isn't included in delete

* lint
This commit is contained in:
melohagan 2023-02-01 12:47:38 +00:00 committed by GitHub
parent f6c7b05ea3
commit 7ce31d64cb

View file

@ -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)