overleaf/services/web/scripts/soft_delete_project.mjs
Jakob Ackermann a7517eefcb Merge pull request #21427 from overleaf/jpa-populate-db-on-import
[web] populate db with collections on import, ahead of waitForDb() call

GitOrigin-RevId: 7eb4cd61c2052187acd9947d7060f54d9822d314
2024-11-01 09:05:15 +00:00

23 lines
586 B
JavaScript

import minimist from 'minimist'
import ProjectDeleter from '../app/src/Features/Project/ProjectDeleter.js'
async function main() {
const argv = minimist(process.argv.slice(2))
const projectId = argv['project-id']
if (!projectId) {
throw new Error('set --project-id')
}
console.log(`Soft deleting project ${projectId}`)
// soft delete, project will be permanently deleted after 90 days
await ProjectDeleter.promises.deleteProject(projectId)
}
try {
await main()
console.log('Done.')
process.exit(0)
} catch (error) {
console.error(error)
process.exit(1)
}