mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-27 05:23:44 +00:00
Accept arrays of messages to send to client
This commit is contained in:
parent
536118b0cf
commit
5da5c5c435
1 changed files with 5 additions and 1 deletions
|
@ -4,5 +4,9 @@ logger = require "logger-sharelatex"
|
|||
module.exports = HttpApiController =
|
||||
sendMessage: (req, res, next) ->
|
||||
logger.log {message: req.params.message}, "sending message"
|
||||
WebsocketLoadBalancer.emitToRoom req.params.project_id, req.params.message, req.body
|
||||
if Array.isArray(req.body)
|
||||
for payload in req.body
|
||||
WebsocketLoadBalancer.emitToRoom req.params.project_id, req.params.message, payload
|
||||
else
|
||||
WebsocketLoadBalancer.emitToRoom req.params.project_id, req.params.message, req.body
|
||||
res.send 204 # No content
|
Loading…
Reference in a new issue