Added Paid to: update protection

This commit is contained in:
Andy Tudhope 2018-03-21 10:51:32 +02:00
parent e69d267cba
commit c418a5c6b8

View File

@ -9,6 +9,7 @@ const github = require('./github')
const winnerString = 'Winner:'
const contractAddressString = 'Contract address: '
const paidString = 'Paid to:'
const logger = winston.createLogger({
level: 'info',
@ -38,10 +39,16 @@ function needsFunding (req) {
return false
} else if (hasWinner(req)) {
return false
} else if (isPaid(req)) {
return false
}
return true
}
function isPaid (req) {
return req.body.comment.body.search(paidString) !== -1
}
function hasWinner (req) {
return req.body.comment.body.search(winnerString) !== -1
}