add bundle

This commit is contained in:
Travis Eden 2018-10-31 09:01:15 -04:00
parent a4b02b9f4b
commit 74d9c6ac36

View file

@ -864,19 +864,29 @@ var claimQueries = (db, table, sequelize) => ({
});
},
getAllChannelClaims: async (channelClaimId) => {
getAllChannelClaims: async (channelClaimId, bidState) => {
logger$1.debug(`claim.getAllChannelClaims for ${channelClaimId}`);
const whereClause = bidState || {
[sequelize.Op.or]: [
{ bid_state: 'Controlling' },
{ bid_state: 'Active' },
{ bid_state: 'Accepted' },
],
};
const selectWhere = {
...whereClause,
publisher_id: channelClaimId,
};
return await table.findAll({
where: { publisher_id: channelClaimId },
where: selectWhere,
order: [['height', 'DESC']],
})
.then(channelClaimsArray => {
if (channelClaimsArray.length === 0) {
return null;
}
return channelClaimsArray;
})
});
},
getClaimIdByLongChannelId: async (channelClaimId, claimName) => {