Leafcutter UI fixes

This commit is contained in:
Darren Clarke 2023-03-31 11:47:51 +02:00
parent f074ec264f
commit b429f195c1
3 changed files with 11 additions and 8 deletions

View file

@ -423,8 +423,6 @@ export const performQuery = async (searchQuery: any, limit: number) => {
});
}
console.log(JSON.stringify(body, null, 2));
const dataResponse = await client.search({
index: dataIndexName,
size: limit,
@ -435,8 +433,12 @@ export const performQuery = async (searchQuery: any, limit: number) => {
hits: { hits },
} = dataResponse.body;
const results = hits.map((hit: any) => ({
id: hit._id,
...hit._source,
id: hit._id,
incident: Array.isArray(hit._source.incident) ? hit._source.incident.join(", ") : hit._source.incident,
technology: Array.isArray(hit._source.technology) ? hit._source.technology.join(", ") : hit._source.technology,
targeted_group: Array.isArray(hit._source.targeted_group) ? hit._source.targeted_group.join(", ") : hit._source.targeted_group,
country: Array.isArray(hit._source.country) ? hit._source.country.join(", ") : hit._source.country,
}));
return results;