mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-28 11:31:55 +02:00
15 lines
419 B
CoffeeScript
15 lines
419 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 res.send(204)
|
|
else
|
|
return next(error)
|
|
res.send 204
|