adbafa4194
fixes!
44 lines
768 B
JavaScript
44 lines
768 B
JavaScript
const db = require('../index.js');
|
|
|
|
const createClaimRecordDataAfterPublish = (
|
|
certificateId,
|
|
channelName,
|
|
fileName,
|
|
fileType,
|
|
publishParams,
|
|
publishResultsOutput
|
|
) => {
|
|
const {
|
|
name,
|
|
title,
|
|
description,
|
|
thumbnail,
|
|
nsfw,
|
|
claim_address: address,
|
|
bid: amount,
|
|
} = publishParams;
|
|
|
|
const { claim_id: claimId, txid, nout } = publishResultsOutput;
|
|
|
|
return db.Claim.getCurrentHeight().then(height => {
|
|
return {
|
|
name,
|
|
claimId,
|
|
title,
|
|
description,
|
|
address,
|
|
thumbnail,
|
|
outpoint: `${txid}:${nout}`,
|
|
height,
|
|
contentType: fileType,
|
|
nsfw,
|
|
amount,
|
|
certificateId,
|
|
channelName,
|
|
};
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
createClaimRecordDataAfterPublish,
|
|
};
|