fix naming mistake

This commit is contained in:
Travis Eden 2018-10-28 18:51:51 -04:00
parent 760edeff1f
commit a210644959

View file

@ -2,8 +2,7 @@ const chainquery = require('chainquery');
const db = require('server/models');
const fetchClaimData = async (params) => {
const name = params.claimName;
let claimId = params.claimId;
let { claimId, claimName: name } = params;
if (claimId === 'none') claimId = null;
const [cq, local] = await Promise.all([
@ -12,8 +11,8 @@ const fetchClaimData = async (params) => {
]);
if (!cq && !local) return null;
if (cq.name === name && !local) return cq;
if (local.name === name && !cq) return local;
if (cq && cq.name === name && !local) return cq;
if (local && local.name === name && !cq) return local;
return local.updatedAt > cq.modified_at ? local : cq;
};