mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #5984 from overleaf/em-unnecessarily-async-functions
Clean up unnecessarily async functions GitOrigin-RevId: 59f0f0a76b4436f3b99a09b747670d443bac4582
This commit is contained in:
@@ -356,23 +356,18 @@ const ProjectController = {
|
||||
if (err != null) {
|
||||
return next(err)
|
||||
}
|
||||
ProjectEntityHandler.getAllEntitiesFromProject(
|
||||
project,
|
||||
(err, docs, files) => {
|
||||
if (err != null) {
|
||||
return next(err)
|
||||
}
|
||||
const entities = docs
|
||||
.concat(files)
|
||||
// Sort by path ascending
|
||||
.sort((a, b) => (a.path > b.path ? 1 : a.path < b.path ? -1 : 0))
|
||||
.map(e => ({
|
||||
path: e.path,
|
||||
type: e.doc != null ? 'doc' : 'file',
|
||||
}))
|
||||
res.json({ project_id: projectId, entities })
|
||||
}
|
||||
const { docs, files } = ProjectEntityHandler.getAllEntitiesFromProject(
|
||||
project
|
||||
)
|
||||
const entities = docs
|
||||
.concat(files)
|
||||
// Sort by path ascending
|
||||
.sort((a, b) => (a.path > b.path ? 1 : a.path < b.path ? -1 : 0))
|
||||
.map(e => ({
|
||||
path: e.path,
|
||||
type: e.doc != null ? 'doc' : 'file',
|
||||
}))
|
||||
res.json({ project_id: projectId, entities })
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user