Skip to content

Commit 92546b9

Browse files
committed
Update MCC scoring logic to work when user enters multiple values
1 parent 6318a70 commit 92546b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mcc/resources/queries/mcc/animalRequests.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,11 @@ function calculatePreliminaryScore(row, oldRow) {
121121
console.error('Unknown MCC institutiontype: ' + row.institutiontype)
122122
}
123123

124-
if (['nih', 'other-federal', 'start-up', 'foundation'].indexOf(row.fundingsource) !== -1) {
124+
var fs = row.fundingsource ? row.fundingsource.split(',') : []
125+
if (fs.indexOf('nih') !== -1 || fs.indexOf('other-federal') !== -1 || fs.indexOf('start-up') !== -1 || fs.indexOf('foundation') !== -1) {
125126
score += 1;
126127
}
127-
else if (row.fundingsource === 'private' || row.fundingsource === 'no-funding') {
128+
else if (fs.indexOf('private') !== -1 || fs.indexOf('no-funding') !== -1) {
128129
// no score change
129130
}
130131
else {

0 commit comments

Comments
 (0)