Move getVoteAuthor to webhookUtils and move user status (api) to webhookUtils

This commit is contained in:
TAG-Epic
2020-08-23 22:30:35 +02:00
parent 20d813d2ea
commit 9eddc330c5
2 changed files with 28 additions and 22 deletions

26
src/utils/webhookUtils.js Normal file
View File

@@ -0,0 +1,26 @@
function getVoteAuthorRaw(submissionCount, isVIP, isOwnSubmission) {
if (isOwnSubmission) {
return "self";
} else if (isVIP) {
return "vip";
} else if (submissionCount === 0) {
return "new";
} else {
return "other";
};
};
function getVoteAuthor(submissionCount, isVIP, isOwnSubmission) {
if (submissionCount === 0) {
return "Report by New User";
} else if (isVIP) {
return "Report by VIP User";
} else if (isOwnSubmission) {
return "Report by Submitter";
}
return "";
}
module.exports.getVoteAuthorRaw = getVoteAuthorRaw;
module.exports.getVoteAuthor = getVoteAuthor;