Migrate Features to ES modules

GitOrigin-RevId: 4e9d3176b4b5a5504afc102e569a27d7788864a3
This commit is contained in:
Andrew Rumble
2024-10-10 11:15:51 +01:00
committed by Copybot
parent fac23dbbdc
commit c6c62088cc
70 changed files with 622 additions and 612 deletions
@@ -0,0 +1,44 @@
/* eslint-disable
max-len,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
import InactiveProjectManager from './InactiveProjectManager.js'
export default {
deactivateOldProjects(req, res) {
const numberOfProjectsToArchive = parseInt(
req.body.numberOfProjectsToArchive,
10
)
const { ageOfProjects } = req.body
return InactiveProjectManager.deactivateOldProjects(
numberOfProjectsToArchive,
ageOfProjects,
function (err, projectsDeactivated) {
if (err != null) {
return res.sendStatus(500)
} else {
return res.json(projectsDeactivated)
}
}
)
},
deactivateProject(req, res) {
const { project_id: projectId } = req.params
return InactiveProjectManager.deactivateProject(projectId, function (err) {
if (err != null) {
return res.sendStatus(500)
} else {
return res.sendStatus(200)
}
})
},
}