71f0b28a84
* Rename files to mjs * Rename test files to mjs * Update CODEOWNERS * Update files to ESM * Update test files to ESM * Update RestoreManager.test.mjs * Remove unused `AdminAuthorizationHelper` mock and stub * Remove unnecessary return GitOrigin-RevId: 2b9ef126de1d8964afbc6e5641cca36712655866
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
/* 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.mjs'
|
|
|
|
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)
|
|
}
|
|
})
|
|
},
|
|
}
|