mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 15:10:48 +02:00
[web] remove deledFiles collection (#25750)
* [history-v1] remove processing of deleted files when back-filling hashes * [web] remove deledFiles collection GitOrigin-RevId: 7c080e564f7d7acb33ebe7ebe012f415a847d0df
This commit is contained in:
@@ -15,7 +15,6 @@ const ProjectGetter = require('./ProjectGetter')
|
||||
const ProjectLocator = require('./ProjectLocator')
|
||||
const FolderStructureBuilder = require('./FolderStructureBuilder')
|
||||
const SafePath = require('./SafePath')
|
||||
const { DeletedFile } = require('../../models/DeletedFile')
|
||||
const { iterablePaths } = require('./IterablePath')
|
||||
|
||||
const LOCK_NAMESPACE = 'mongoTransaction'
|
||||
@@ -72,7 +71,6 @@ module.exports = {
|
||||
'changes',
|
||||
]),
|
||||
createNewFolderStructure: callbackify(wrapWithLock(createNewFolderStructure)),
|
||||
_insertDeletedFileReference: callbackify(_insertDeletedFileReference),
|
||||
_putElement: callbackifyMultiResult(_putElement, ['result', 'project']),
|
||||
_confirmFolder,
|
||||
promises: {
|
||||
@@ -87,7 +85,6 @@ module.exports = {
|
||||
deleteEntity: wrapWithLock(deleteEntity),
|
||||
renameEntity: wrapWithLock(renameEntity),
|
||||
createNewFolderStructure: wrapWithLock(createNewFolderStructure),
|
||||
_insertDeletedFileReference,
|
||||
_putElement,
|
||||
},
|
||||
}
|
||||
@@ -162,7 +159,6 @@ async function replaceFileWithNew(projectId, fileId, newFileRef, userId) {
|
||||
element_id: fileId,
|
||||
type: 'file',
|
||||
})
|
||||
await _insertDeletedFileReference(projectId, fileRef)
|
||||
const newProject = await Project.findOneAndUpdate(
|
||||
{ _id: project._id, [path.mongo]: { $exists: true } },
|
||||
{
|
||||
@@ -480,17 +476,6 @@ async function renameEntity(projectId, entityId, entityType, newName, userId) {
|
||||
}
|
||||
}
|
||||
|
||||
async function _insertDeletedFileReference(projectId, fileRef) {
|
||||
await DeletedFile.create({
|
||||
projectId,
|
||||
_id: fileRef._id,
|
||||
name: fileRef.name,
|
||||
linkedFileData: fileRef.linkedFileData,
|
||||
hash: fileRef.hash,
|
||||
deletedAt: new Date(),
|
||||
})
|
||||
}
|
||||
|
||||
async function _removeElementFromMongoArray(
|
||||
modelId,
|
||||
path,
|
||||
|
||||
Reference in New Issue
Block a user