avoid error when passing as limit in mongo query

convert request parameter from string to number
This commit is contained in:
Brian Gough 2017-09-05 12:33:13 +01:00
parent 404749acaf
commit 3ac0e97a14

View file

@ -6,7 +6,7 @@ module.exports =
deactivateOldProjects: (req, res)->
logger.log "recived request to deactivate old projects"
numberOfProjectsToArchive = req.body.numberOfProjectsToArchive
numberOfProjectsToArchive = parseInt(req.body.numberOfProjectsToArchive, 10)
ageOfProjects = req.body.ageOfProjects
InactiveProjectManager.deactivateOldProjects numberOfProjectsToArchive, ageOfProjects, (err, projectsDeactivated)->
if err?