mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Send operations to project-history when resolving/unresolving comments (#17540)
* Send operations to project-history when resolving/unresolving comments * small fixes * added doc_id in web unit test * Revert "added doc_id in web unit test" This reverts commit f0b8251abfce17965d5e1b0e45d8784fcf1d9eed. * fix mocked dependency in test * wip: web unit tests * document updater, reopen test * document-updater tests * format fix * fix typo * fix callsArgWith * fix reopenThread calls in doc updater tests * fix typos * log error if chat api resolve failes * log error when reopening thread * sendStatus calls done() in tests * using OError instead of logging * removed timers * preserve legacy endpoints * update after merge * Remove timer check in HttpControllerTest * prettier * added "legacy" in log * remove metrics.timer * fix promisify issues * remove unused cb GitOrigin-RevId: 849538c86996973a065c727835e93028e5429344
This commit is contained in:
committed by
Copybot
parent
1557338775
commit
8bde496da4
@@ -23,6 +23,8 @@ module.exports = {
|
||||
deleteProject,
|
||||
deleteMultipleProjects,
|
||||
acceptChanges,
|
||||
resolveComment,
|
||||
reopenComment,
|
||||
deleteComment,
|
||||
updateProject,
|
||||
resyncProjectHistory,
|
||||
@@ -301,6 +303,54 @@ function acceptChanges(req, res, next) {
|
||||
})
|
||||
}
|
||||
|
||||
function resolveComment(req, res, next) {
|
||||
const {
|
||||
project_id: projectId,
|
||||
doc_id: docId,
|
||||
comment_id: commentId,
|
||||
} = req.params
|
||||
const userId = req.body.user_id
|
||||
logger.debug({ projectId, docId, commentId }, 'resolving comment via http')
|
||||
DocumentManager.updateCommentStateWithLock(
|
||||
projectId,
|
||||
docId,
|
||||
commentId,
|
||||
userId,
|
||||
true,
|
||||
error => {
|
||||
if (error) {
|
||||
return next(error)
|
||||
}
|
||||
logger.debug({ projectId, docId, commentId }, 'resolved comment via http')
|
||||
res.sendStatus(204) // No Content
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function reopenComment(req, res, next) {
|
||||
const {
|
||||
project_id: projectId,
|
||||
doc_id: docId,
|
||||
comment_id: commentId,
|
||||
} = req.params
|
||||
const userId = req.body.user_id
|
||||
logger.debug({ projectId, docId, commentId }, 'reopening comment via http')
|
||||
DocumentManager.updateCommentStateWithLock(
|
||||
projectId,
|
||||
docId,
|
||||
commentId,
|
||||
userId,
|
||||
false,
|
||||
error => {
|
||||
if (error) {
|
||||
return next(error)
|
||||
}
|
||||
logger.debug({ projectId, docId, commentId }, 'reopened comment via http')
|
||||
res.sendStatus(204) // No Content
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function deleteComment(req, res, next) {
|
||||
const {
|
||||
project_id: projectId,
|
||||
|
||||
Reference in New Issue
Block a user