pass options through stating how long ago want to archive from and limit

This commit is contained in:
Henry Oswald
2015-08-14 14:11:53 +01:00
parent 70b825fd2a
commit d3499acd7b
2 changed files with 12 additions and 7 deletions
@@ -6,11 +6,13 @@ module.exports =
deactivateOldProjects: (req, res)->
logger.log "recived request to deactivate old projects"
InactiveProjectManager.deactivateOldProjects 10, (err)->
numberOfProjectsToArchive = req.query.limit
ageOfProjects = req.query.daysOld
InactiveProjectManager.deactivateOldProjects numberOfProjectsToArchive, ageOfProjects, (err, projectsDeactivated)->
if err?
res.sendStatus(500)
else
res.sendStatus(200)
res.send(projectsDeactivated)
deactivateProject: (req, res)->