mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 22:29:01 +02:00
Merge pull request #3495 from overleaf/ae-prettier-2
Upgrade Prettier to v2 GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
@@ -21,22 +21,22 @@ module.exports = MetaController = {
|
||||
getMetadata(req, res, next) {
|
||||
const { project_id } = req.params
|
||||
logger.log({ project_id }, 'getting all labels for project')
|
||||
return MetaHandler.getAllMetaForProject(project_id, function(
|
||||
err,
|
||||
projectMeta
|
||||
) {
|
||||
if (err != null) {
|
||||
OError.tag(
|
||||
err,
|
||||
'[MetaController] error getting all labels from project',
|
||||
{
|
||||
project_id
|
||||
}
|
||||
)
|
||||
return next(err)
|
||||
return MetaHandler.getAllMetaForProject(
|
||||
project_id,
|
||||
function (err, projectMeta) {
|
||||
if (err != null) {
|
||||
OError.tag(
|
||||
err,
|
||||
'[MetaController] error getting all labels from project',
|
||||
{
|
||||
project_id
|
||||
}
|
||||
)
|
||||
return next(err)
|
||||
}
|
||||
return res.json({ projectId: project_id, projectMeta })
|
||||
}
|
||||
return res.json({ projectId: project_id, projectMeta })
|
||||
})
|
||||
)
|
||||
},
|
||||
|
||||
broadcastMetadataForDoc(req, res, next) {
|
||||
@@ -44,27 +44,28 @@ module.exports = MetaController = {
|
||||
const { doc_id } = req.params
|
||||
const { broadcast } = req.body
|
||||
logger.log({ project_id, doc_id, broadcast }, 'getting labels for doc')
|
||||
return MetaHandler.getMetaForDoc(project_id, doc_id, function(
|
||||
err,
|
||||
docMeta
|
||||
) {
|
||||
if (err != null) {
|
||||
OError.tag(err, '[MetaController] error getting labels from doc', {
|
||||
project_id,
|
||||
doc_id
|
||||
})
|
||||
return next(err)
|
||||
return MetaHandler.getMetaForDoc(
|
||||
project_id,
|
||||
doc_id,
|
||||
function (err, docMeta) {
|
||||
if (err != null) {
|
||||
OError.tag(err, '[MetaController] error getting labels from doc', {
|
||||
project_id,
|
||||
doc_id
|
||||
})
|
||||
return next(err)
|
||||
}
|
||||
// default to broadcasting, unless explicitly disabled (for backwards compatibility)
|
||||
if (broadcast !== false) {
|
||||
EditorRealTimeController.emitToRoom(project_id, 'broadcastDocMeta', {
|
||||
docId: doc_id,
|
||||
meta: docMeta
|
||||
})
|
||||
return res.sendStatus(200)
|
||||
} else {
|
||||
return res.json({ docId: doc_id, meta: docMeta })
|
||||
}
|
||||
}
|
||||
// default to broadcasting, unless explicitly disabled (for backwards compatibility)
|
||||
if (broadcast !== false) {
|
||||
EditorRealTimeController.emitToRoom(project_id, 'broadcastDocMeta', {
|
||||
docId: doc_id,
|
||||
meta: docMeta
|
||||
})
|
||||
return res.sendStatus(200)
|
||||
} else {
|
||||
return res.json({ docId: doc_id, meta: docMeta })
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user