Fix vanity + bid state for URLs

This ensures controlling is returned first.
This commit is contained in:
Thomas Zarebczan 2020-08-11 18:07:49 -04:00 committed by GitHub
parent a31f14b016
commit b14f3c87f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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")';
sql += ' AND claim.bid_state in ("controlling", "active", "accepted") ORDER BY claim.bid_state desc';
if (claimName[0] !== '@' && channelName) {
sql += ' AND channel_claim.name = ?';
@ -49,7 +49,7 @@ 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")';
sql += ' AND channel_claim.bid_state in ("controlling", "active", "accepted") ORDER BY channel_claim.bid_state desc';
}
}