mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
3ac0e97a14
convert request parameter from string to number
25 lines
No EOL
807 B
CoffeeScript
25 lines
No EOL
807 B
CoffeeScript
InactiveProjectManager = require("./InactiveProjectManager")
|
|
logger = require("logger-sharelatex")
|
|
|
|
|
|
module.exports =
|
|
|
|
deactivateOldProjects: (req, res)->
|
|
logger.log "recived request to deactivate old projects"
|
|
numberOfProjectsToArchive = parseInt(req.body.numberOfProjectsToArchive, 10)
|
|
ageOfProjects = req.body.ageOfProjects
|
|
InactiveProjectManager.deactivateOldProjects numberOfProjectsToArchive, ageOfProjects, (err, projectsDeactivated)->
|
|
if err?
|
|
res.sendStatus(500)
|
|
else
|
|
res.send(projectsDeactivated)
|
|
|
|
|
|
deactivateProject: (req, res)->
|
|
project_id = req.params.project_id
|
|
logger.log project_id:project_id, "recived request to deactivating project"
|
|
InactiveProjectManager.deactivateProject project_id, (err)->
|
|
if err?
|
|
res.sendStatus 500
|
|
else
|
|
res.sendStatus 200 |