refactor: simplify rate function

This commit is contained in:
Rafael Taranto 2024-05-29 10:34:59 +01:00
parent ea92fa5c6d
commit a55388d290

View file

@ -20,7 +20,7 @@ const TYPE = {
}
function rate (account, objectType, cryptoCode, objectId) {
if (_.isNil(account) || !account.enabled || !Object.keys(SUPPORTED_COINS).includes(cryptoCode)) return Promise.resolve(null)
if (!isWalletScoringEnabled(account, cryptoCode)) return Promise.resolve(null)
const threshold = account.scoreThreshold
const payload = {