Merge pull request #593 from sharelatex/bg-fix-inactive-projects-request

avoid error when passing as limit in mongo query
This commit is contained in:
Brian Gough 2017-09-11 08:16:28 +01:00 committed by GitHub
commit 5430c8a3c2

View file

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