mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
No need to return message after editing
This commit is contained in:
parent
fa63eb6947
commit
7cf5db4c63
3 changed files with 3 additions and 7 deletions
|
@ -60,7 +60,7 @@ module.exports = MessageHttpController =
|
|||
return next(error) if error?
|
||||
MessageManager.updateMessage room._id, message_id, content, Date.now(), (error) ->
|
||||
return next(error) if error?
|
||||
res.send(200)
|
||||
res.send(204)
|
||||
|
||||
deleteMessage: (req, res, next) ->
|
||||
{project_id, thread_id, message_id} = req.params
|
||||
|
|
|
@ -43,9 +43,7 @@ module.exports = MessageManager =
|
|||
edited_at: timestamp
|
||||
}, (error) ->
|
||||
return callback(error) if error?
|
||||
db.messages.find query, (error, messages) ->
|
||||
return callback(error) if error?
|
||||
return callback null, messages[0]
|
||||
return callback()
|
||||
|
||||
deleteMessage: (room_id, message_id, callback = (error) ->) ->
|
||||
query = @_ensureIdsAreObjectIds(
|
||||
|
|
|
@ -20,9 +20,7 @@ describe "Editing a message", ->
|
|||
expect(@message.content).to.equal @content
|
||||
ChatClient.editMessage @project_id, @thread_id, @message.id, @new_content, (error, response, @new_message) =>
|
||||
expect(error).to.be.null
|
||||
expect(response.statusCode).to.equal 201
|
||||
expect(@new_message.edited_at).to.exist
|
||||
expect(@new_message.content).to.equal @new_content
|
||||
expect(response.statusCode).to.equal 204
|
||||
done()
|
||||
|
||||
it "should then list the updated message in the threads", (done) ->
|
||||
|
|
Loading…
Reference in a new issue