format fix

GitOrigin-RevId: 71faf86ccd19dfa6428c2d5bcc8c88ec7f0ee41f
This commit is contained in:
Ersun Warncke
2020-01-22 12:38:11 -04:00
committed by Copybot
parent 74ecb4bebe
commit 3bf57edd14
3 changed files with 66 additions and 44 deletions

View File

@@ -316,7 +316,10 @@ async function deleteEntity(projectId, entityId, entityType, callback) {
projectId,
{ name: true, rootFolder: true, overleaf: true, rootDoc_id: true }
)
const deleteRootDoc = project.rootDoc_id && entityId && project.rootDoc_id.toString() === entityId.toString()
const deleteRootDoc =
project.rootDoc_id &&
entityId &&
project.rootDoc_id.toString() === entityId.toString()
const { element: entity, path } = await ProjectLocator.promises.findElement({
project,
element_id: entityId,
@@ -416,7 +419,13 @@ async function _insertDeletedFileReference(projectId, fileRef) {
).exec()
}
async function _removeElementFromMongoArray(model, modelId, path, elementId, deleteRootDoc=false) {
async function _removeElementFromMongoArray(
model,
modelId,
path,
elementId,
deleteRootDoc = false
) {
const nonArrayPath = path.slice(0, path.lastIndexOf('.'))
const options = { new: true }
const query = { _id: modelId }