Check for Claim field

This commit is contained in:
Mark Beamer Jr 2019-06-20 23:26:36 -04:00
parent 3a061df1a4
commit 4f5206d18e
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973

View file

@ -52,6 +52,8 @@ export async function claimSync () {
let claims = JSON.parse(claimsResponse).data;
status.info = 'addingClaimsToElastic';
for (let claim of claims) {
const parsedClaim = JSON.parse(claim.value);
if (parsedClaim.Claim) {
claim.value = JSON.parse(claim.value).Claim;
if (claim.name && claim.value) {
claim.suggest_name = {
@ -66,6 +68,7 @@ export async function claimSync () {
}
lastID = claim.id;
}
}
winston.log('info', '[Importer] Pushed ' + claims.length + ' claims to elastic search [LastID]' + lastID);
finished = claims.length < groupSize;
}