mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
[web] emit mention notifications (#35611)
GitOrigin-RevId: 4852c217a8bf7f1fe71696604acbb0f7434d3f2a
This commit is contained in:
@@ -85,6 +85,25 @@ class MockChatApi extends AbstractMockApi {
|
||||
)
|
||||
}
|
||||
)
|
||||
this.app.post(
|
||||
'/project/:project_id/thread/:thread_id/messages/:message_id/edit',
|
||||
(req, res) => {
|
||||
const {
|
||||
project_id: projectId,
|
||||
thread_id: threadId,
|
||||
message_id: messageId,
|
||||
} = req.params
|
||||
const { content, userId } = req.body
|
||||
const thread = this.getThread(projectId, threadId)
|
||||
const message = thread.find(msg => msg.id === messageId)
|
||||
if (!message || (userId && message.user_id !== userId)) {
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
message.content = content
|
||||
message.edited_at = Date.now()
|
||||
res.sendStatus(204)
|
||||
}
|
||||
)
|
||||
this.app.delete('/project/:project_id', (req, res) => {
|
||||
const projectId = req.params.project_id
|
||||
this.destroyProject(projectId)
|
||||
|
||||
@@ -21,6 +21,7 @@ export type CommentAddedEvent = {
|
||||
userId: string
|
||||
threadId: string
|
||||
messageId: string
|
||||
content: string
|
||||
}
|
||||
|
||||
export type CommentResolvedEvent = {
|
||||
@@ -40,6 +41,7 @@ export type CommentEditedEvent = {
|
||||
userId: string
|
||||
threadId: string
|
||||
messageId: string
|
||||
content: string
|
||||
}
|
||||
|
||||
export type CommentDeletedEvent = {
|
||||
|
||||
Reference in New Issue
Block a user