From 26dbae7cef5a8ba8e735d11b8fe39b1fe8c0c6a5 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Fri, 21 May 2021 13:32:30 +0200 Subject: [PATCH] Merge pull request #4078 from overleaf/em-restore-deleted-docs Fix restore_soft_deleted_docs script GitOrigin-RevId: c21ea407ed9f6fb969b36d5452f38e446eff1c8b --- services/web/scripts/restore_soft_deleted_docs.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/web/scripts/restore_soft_deleted_docs.js b/services/web/scripts/restore_soft_deleted_docs.js index 19b2d54d70..365a8e2814 100644 --- a/services/web/scripts/restore_soft_deleted_docs.js +++ b/services/web/scripts/restore_soft_deleted_docs.js @@ -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) {