mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #4078 from overleaf/em-restore-deleted-docs
Fix restore_soft_deleted_docs script GitOrigin-RevId: c21ea407ed9f6fb969b36d5452f38e446eff1c8b
This commit is contained in:
parent
da782bdcfa
commit
26dbae7cef
1 changed files with 5 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
const { waitForDb } = require('../app/src/infrastructure/mongodb')
|
||||
const ProjectEntityUpdateHandler = require('../app/src/Features/Project/ProjectEntityUpdateHandler')
|
||||
const ProjectEntityHandler = require('../app/src/Features/Project/ProjectEntityHandler')
|
||||
const ProjectGetter = require('../app/src/Features/Project/ProjectGetter')
|
||||
const DocstoreManager = require('../app/src/Features/Docstore/DocstoreManager')
|
||||
const Path = require('path')
|
||||
|
||||
const ARGV = process.argv.slice(2)
|
||||
|
@ -10,10 +10,10 @@ const PROJECT_ID = ARGV.shift()
|
|||
const FILE_NAMES_TO_RESTORE = ARGV
|
||||
|
||||
async function main() {
|
||||
const project = await ProjectGetter.promises.getProject(PROJECT_ID, {
|
||||
deletedDocs: 1,
|
||||
})
|
||||
const docsToRestore = project.deletedDocs.filter(doc =>
|
||||
const deletedDocs = await DocstoreManager.promises.getAllDeletedDocs(
|
||||
PROJECT_ID
|
||||
)
|
||||
const docsToRestore = deletedDocs.filter(doc =>
|
||||
FILE_NAMES_TO_RESTORE.includes(doc.name)
|
||||
)
|
||||
for (const deletedDoc of docsToRestore) {
|
||||
|
|
Loading…
Reference in a new issue