fixed issue with Op.like

This commit is contained in:
bill bittner 2017-10-31 20:35:33 -07:00
parent d3316b416d
commit e48a7b596d
2 changed files with 3 additions and 4 deletions

View file

@ -153,10 +153,10 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, D
where: {
name : channelName,
claimId: {
[Op.like]: `${channelId}%`,
[sequelize.Op.like]: `${channelId}%`,
},
order: [['height', 'ASC']],
},
order: [['height', 'ASC']],
})
.then(result => {
switch (result.length) {

View file

@ -250,7 +250,6 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, D
});
};
// sequelize.query(`SELECT claimId FROM Claim WHERE name = '${name}' AND claimId LIKE '${shortId}%' ORDER BY height ASC LIMIT 1;`, { type: db.sequelize.QueryTypes.SELECT })
Claim.getLongClaimIdFromShortClaimId = function (name, shortId) {
return new Promise((resolve, reject) => {
this
@ -258,7 +257,7 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, D
where: {
name,
claimId: {
[Op.like]: `${shortId}%`,
[sequelize.Op.like]: `${shortId}%`,
}},
order: [['height', 'ASC']],
})