This repository has been archived on 2025-11-04. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
qoverflow/server/utils/badges/answerBadges.js
2022-08-18 14:20:46 -04:00

17 lines
326 B
JavaScript

function calculateAnswerBadges(points) {
let badges = [];
if (points >= 100) {
badges.push('Great Answer');
}
if (points >= 25) {
badges.push('Good Answer');
}
if (points >= 10) {
badges.push('Nice Answer');
}
return badges;
}
module.exports = calculateAnswerBadges;