mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-28 22:03:16 -05:00
a7517eefcb
[web] populate db with collections on import, ahead of waitForDb() call GitOrigin-RevId: 7eb4cd61c2052187acd9947d7060f54d9822d314
23 lines
604 B
JavaScript
23 lines
604 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']
|
|
const userId = argv['user-id']
|
|
|
|
if (!projectId || !userId) {
|
|
throw new Error('set --project-id and --user-id')
|
|
}
|
|
console.log(`Restoring project ${projectId} to user ${userId}`)
|
|
await ProjectDeleter.promises.undeleteProject(projectId, { userId })
|
|
}
|
|
|
|
try {
|
|
await main()
|
|
console.log('Done.')
|
|
process.exit(0)
|
|
} catch (error) {
|
|
console.error(error)
|
|
process.exit(1)
|
|
}
|