mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 21:59:00 +02:00
Merge pull request #7307 from overleaf/jpa-notify-editor-restore-doc
[web] notify the editor after restoring a deleted doc GitOrigin-RevId: 4bd316958827c83a56a82f9ff72f5ff803d32631
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const { callbackify } = require('util')
|
||||
const Path = require('path')
|
||||
const ProjectEntityHandler = require('./ProjectEntityHandler')
|
||||
const ProjectEntityUpdateHandler = require('./ProjectEntityUpdateHandler')
|
||||
const EditorController = require('../Editor/EditorController')
|
||||
|
||||
// generate a new name based on the original, with an optional label.
|
||||
// e.g. origname-20210101-122345.tex (default)
|
||||
@@ -24,12 +24,14 @@ async function restoreDeletedDoc(projectId, docId, docName, userId) {
|
||||
{ include_deleted: true }
|
||||
)
|
||||
const deletedDocName = generateRestoredName(docName)
|
||||
return await ProjectEntityUpdateHandler.promises.addDocWithRanges(
|
||||
// Create the doc and emit a websocket message.
|
||||
return await EditorController.promises.addDocWithRanges(
|
||||
projectId,
|
||||
null,
|
||||
`${deletedDocName}`,
|
||||
deletedDoc.lines,
|
||||
deletedDoc.ranges,
|
||||
null,
|
||||
userId
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user