No need to return message after editing

This commit is contained in:
James Allen 2017-01-25 14:47:45 +01:00
parent fa63eb6947
commit 7cf5db4c63
3 changed files with 3 additions and 7 deletions

View file

@ -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

View file

@ -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(

View file

@ -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) ->