diff --git a/server/controllers/api/claim/publish/publish.js b/server/controllers/api/claim/publish/publish.js index 88d774dc..21de83bd 100644 --- a/server/controllers/api/claim/publish/publish.js +++ b/server/controllers/api/claim/publish/publish.js @@ -10,9 +10,12 @@ const publish = (publishParams, fileName, fileType) => { let publishResults, certificateId, channelName; // publish the file return publishClaim(publishParams) - .then(tx => { - logger.info(`Successfully published ${publishParams.name} ${fileName}`, tx); - publishResults = tx; + .then(result => { + logger.info(`Successfully published ${publishParams.name} ${fileName}`, result); + + // Support new daemon, TODO: remove + publishResults = result.output && result.output.claim_id ? result.output : result; + // get the channel information if (publishParams.channel_name) { logger.debug(`this claim was published in channel: ${publishParams.channel_name}`); diff --git a/server/controllers/api/claim/shortId/index.js b/server/controllers/api/claim/shortId/index.js index e8d820e2..e78a73f5 100644 --- a/server/controllers/api/claim/shortId/index.js +++ b/server/controllers/api/claim/shortId/index.js @@ -12,7 +12,7 @@ const claimShortId = async ({ ip, originalUrl, body, params }, res) => { try { let shortId = await chainquery.claim.queries.getShortClaimIdFromLongClaimId(params.longId, params.name).catch(() => {}); - if(shortId === null) { + if(!shortId) { shortId = await db.Claim.getShortClaimIdFromLongClaimId(params.longId, params.name); }