fix naming mistake
This commit is contained in:
parent
760edeff1f
commit
a210644959
1 changed files with 3 additions and 4 deletions
|
@ -2,8 +2,7 @@ const chainquery = require('chainquery');
|
||||||
const db = require('server/models');
|
const db = require('server/models');
|
||||||
|
|
||||||
const fetchClaimData = async (params) => {
|
const fetchClaimData = async (params) => {
|
||||||
const name = params.claimName;
|
let { claimId, claimName: name } = params;
|
||||||
let claimId = params.claimId;
|
|
||||||
if (claimId === 'none') claimId = null;
|
if (claimId === 'none') claimId = null;
|
||||||
|
|
||||||
const [cq, local] = await Promise.all([
|
const [cq, local] = await Promise.all([
|
||||||
|
@ -12,8 +11,8 @@ const fetchClaimData = async (params) => {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!cq && !local) return null;
|
if (!cq && !local) return null;
|
||||||
if (cq.name === name && !local) return cq;
|
if (cq && cq.name === name && !local) return cq;
|
||||||
if (local.name === name && !cq) return local;
|
if (local && local.name === name && !cq) return local;
|
||||||
return local.updatedAt > cq.modified_at ? local : cq;
|
return local.updatedAt > cq.modified_at ? local : cq;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue