Merge pull request #7220 from overleaf/jpa-wait-for-db

[web] scripts/undelete_project_to_user: add missing wait for db call

GitOrigin-RevId: 80a767d26ee529c0aabf8ce11a010dca4a51be2b
This commit is contained in:
Jakob Ackermann 2022-03-24 16:31:15 +00:00 committed by Copybot
parent d993144fec
commit 1bee808551

View file

@ -1,4 +1,5 @@
const minimist = require('minimist')
const { waitForDb } = require('../app/src/infrastructure/mongodb')
const ProjectDeleter = require('../app/src/Features/Project/ProjectDeleter')
async function main() {
@ -10,6 +11,7 @@ async function main() {
throw new Error('set --project-id and --user-id')
}
console.log(`Restoring project ${projectId} to user ${userId}`)
await waitForDb()
await ProjectDeleter.promises.undeleteProject(projectId, { userId })
}