fix: properly check if an object exists before update

Closes #70
This commit is contained in:
Jovan Krunić
2020-10-06 14:16:05 +02:00
committed by Rainer Killinger
parent 0c43be2dbe
commit e165837a15

View File

@@ -234,7 +234,7 @@ export class Elasticsearch implements Database {
size: 1,
});
if (searchResponse.body.hits.total > 1) {
if (searchResponse.body.hits.total > 0) {
return {
exists: true,
object: searchResponse.body.hits.hits[0],