Commit d0ce5116 authored by tobinski's avatar tobinski
Browse files

Hack around wrong typescript definitions

parent cecdd48e
......@@ -12,5 +12,6 @@ export function createClient(nconf: Provider): Client {
hosts: [
`${nconf.get('elasticsearch:server')}:${nconf.get('elasticsearch:port')}/`,
],
apiVersion: '7.2',
});
}
......@@ -43,7 +43,9 @@ class ElasticSearchTransformer extends Transform {
const result: SearchResponse<any> = await this.client.search(query);
// get links or empty array
if (result.hits.total.value !== 0) {
// hack because of wrong definitions ins typescript
const total: any = result.hits.total;
if (total.value !== 0) {
links = result.hits.hits.map((hit) => {
return hit._source.url;
});
......@@ -87,7 +89,8 @@ class ElasticSearchTransformer extends Transform {
},
});
if (baseEntity.hits.total.value === 0) {
const total: any = baseEntity.hits.total;
if (total.value === 0) {
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment