From e092ae3231e24a710b7a8922e2d16aeda2a24d4f Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Wed, 12 Aug 2020 08:59:31 -0400 Subject: [PATCH] Fix SQL for previews --- web/src/chainquery.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/chainquery.js b/web/src/chainquery.js index 35e6e06f4..9b6d9d57f 100644 --- a/web/src/chainquery.js +++ b/web/src/chainquery.js @@ -40,7 +40,7 @@ module.exports.getClaim = async function getClaim(claimName, claimId, channelNam params.push(claimId + '%'); } - sql += ' AND claim.bid_state in ("controlling", "active", "accepted") ORDER BY claim.bid_state desc'; + sql += ' AND claim.bid_state in ("controlling", "active", "accepted")'; if (claimName[0] !== '@' && channelName) { sql += ' AND channel_claim.name = ?'; @@ -49,11 +49,11 @@ module.exports.getClaim = async function getClaim(claimName, claimId, channelNam sql += ' AND channel_claim.claim_id LIKE ?'; params.push(channelClaimId + '%'); } else { - sql += ' AND channel_claim.bid_state in ("controlling", "active", "accepted") ORDER BY channel_claim.bid_state desc'; + sql += ' AND channel_claim.bid_state in ("controlling", "active", "accepted")'; } } - sql += ' LIMIT 1'; + sql += ' ORDER BY claim.bid_state DESC LIMIT 1'; return queryPool(sql, params); };