fix es storage object
This commit is contained in:
parent
e7cf20eda4
commit
f1ad94d29d
1 changed files with 9 additions and 2 deletions
|
@ -75,7 +75,7 @@ export async function claimSync () {
|
||||||
console.error('Failed to process claim ' + claim.claimId + ' due to missing value');
|
console.error('Failed to process claim ' + claim.claimId + ' due to missing value');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
claim.value = JSON.parse(claim.value).Claim;
|
claim.value = claim.value.Claim;
|
||||||
if (claim.name && claim.value) {
|
if (claim.name && claim.value) {
|
||||||
claim.suggest_name = {
|
claim.suggest_name = {
|
||||||
input : '' + claim.name + '',
|
input : '' + claim.name + '',
|
||||||
|
@ -217,6 +217,13 @@ function getClaimsSince (time, lastID, MaxClaimsInCall) {
|
||||||
let claims = [];
|
let claims = [];
|
||||||
for (let i = 0; i < results.length; i++) {
|
for (let i = 0; i < results.length; i++) {
|
||||||
let r = results[i];
|
let r = results[i];
|
||||||
|
let value = null;
|
||||||
|
try {
|
||||||
|
value = JSON.parse(r.value);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
console.error(r.value);
|
||||||
|
}
|
||||||
claims.push({
|
claims.push({
|
||||||
id : r.id,
|
id : r.id,
|
||||||
name : r.name,
|
name : r.name,
|
||||||
|
@ -225,7 +232,7 @@ function getClaimsSince (time, lastID, MaxClaimsInCall) {
|
||||||
effective_amount : r.effective_amount,
|
effective_amount : r.effective_amount,
|
||||||
certificate_amount: r.certificate_amount,
|
certificate_amount: r.certificate_amount,
|
||||||
claimId : r.claimId,
|
claimId : r.claimId,
|
||||||
value : r.value,
|
value : value,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
resolve(claims);
|
resolve(claims);
|
||||||
|
|
Loading…
Reference in a new issue