Fix remaining chainquery exceptions and bad logic
This commit is contained in:
parent
bb81441357
commit
2e45314610
4 changed files with 5 additions and 5 deletions
|
@ -10,7 +10,7 @@ const chainquery = require('chainquery');
|
||||||
|
|
||||||
const claimShortId = async ({ ip, originalUrl, body, params }, res) => {
|
const claimShortId = async ({ ip, originalUrl, body, params }, res) => {
|
||||||
try {
|
try {
|
||||||
let shortId = await chainquery.claim.queries.getShortClaimIdFromLongClaimId(params.longId, params.name);
|
let shortId = await chainquery.claim.queries.getShortClaimIdFromLongClaimId(params.longId, params.name).catch(() => {});
|
||||||
|
|
||||||
if(shortId === null) {
|
if(shortId === null) {
|
||||||
shortId = await db.Claim.getShortClaimIdFromLongClaimId(params.longId, params.name);
|
shortId = await db.Claim.getShortClaimIdFromLongClaimId(params.longId, params.name);
|
||||||
|
|
|
@ -25,11 +25,11 @@ const getClaimIdAndServeAsset = (channelName, channelClaimId, claimName, claimId
|
||||||
})
|
})
|
||||||
.then(claim => {
|
.then(claim => {
|
||||||
if (!claim) {
|
if (!claim) {
|
||||||
logger.debug('Full claim id:', fullClaimId);
|
logger.debug('Full claim id:', claimId);
|
||||||
return db.Claim.findOne({
|
return db.Claim.findOne({
|
||||||
where: {
|
where: {
|
||||||
name : claimName,
|
name : claimName,
|
||||||
claimId: fullClaimId,
|
claimId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ const getClaimId = async (channelName, channelClaimId, name, claimId) => {
|
||||||
} else {
|
} else {
|
||||||
let claimIdResult = await chainquery.claim.queries.getLongClaimId(name, claimId);
|
let claimIdResult = await chainquery.claim.queries.getLongClaimId(name, claimId);
|
||||||
|
|
||||||
if(claimIdResult === null) {
|
if(!claimIdResult) {
|
||||||
claimIdResult = await db.Claim.getLongClaimId(name, claimId);
|
claimIdResult = await db.Claim.getLongClaimId(name, claimId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue