Sequelize queries #234
2 changed files with 3 additions and 4 deletions
|
@ -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']],
|
||||
},
|
||||
})
|
||||
.then(result => {
|
||||
switch (result.length) {
|
||||
|
|
|
@ -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']],
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue