mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
14 lines
415 B
CoffeeScript
14 lines
415 B
CoffeeScript
AnalyticsManager = require "./AnalyticsManager"
|
|
Errors = require "../Errors/Errors"
|
|
|
|
|
|
module.exports = AnalyticsController =
|
|
recordEvent: (req, res, next) ->
|
|
AnalyticsManager.recordEvent req.session?.user?._id, req.params.event, req.body, (error) ->
|
|
if error?
|
|
if error instanceof Errors.ServiceNotConfiguredError
|
|
# ignore, no-op
|
|
return next(204)
|
|
else
|
|
return next(error)
|
|
res.send 204
|