fixed issue with getClaimIdByLongChannelId

This commit is contained in:
bill bittner 2017-08-22 16:14:42 -07:00
parent 5078d4e906
commit 994b3c6ce4
2 changed files with 4 additions and 4 deletions

View file

@ -85,7 +85,7 @@ module.exports = {
getAssetByChannel (channelName, channelId, claimName) {
logger.debug('channelId =', channelId);
return new Promise((resolve, reject) => {
getClaimIdByChannel(channelName, channelId)
getClaimIdByChannel(channelName, channelId, claimName)
.then(claimId => {
logger.debug('claim id = ', claimId);
resolve(getAssetByClaimId(claimId, claimName));

View file

@ -49,10 +49,10 @@ function getLongChannelId (channelName, channelId) {
}
};
function getClaimIdByLongChannelId (channelId, name) {
function getClaimIdByLongChannelId (channelId, claimName) {
return new Promise((resolve, reject) => {
logger.debug('finding claim id from channel id and claim name');
db.sequelize.query(`SELECT claimId FROM Claim WHERE name = '${name}' AND certificateId = '${channelId}' LIMIT 1;`, { type: db.sequelize.QueryTypes.SELECT })
logger.debug(`finding claim id for claim "${claimName}" from channel "${channelId}"`);
db.sequelize.query(`SELECT claimId FROM Claim WHERE name = '${claimName}' AND certificateId = '${channelId}' LIMIT 1;`, { type: db.sequelize.QueryTypes.SELECT })
.then(result => {
switch (result.length) {
case 0: