mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
5a13ee1077
- don’t talk to postgres - show recent blog post announcments - proxy all events to analytics api
21 lines
567 B
CoffeeScript
21 lines
567 B
CoffeeScript
AnnouncementsHandler = require("./AnnouncementsHandler")
|
|
AuthenticationController = require("../Authentication/AuthenticationController")
|
|
logger = require("logger-sharelatex")
|
|
|
|
|
|
module.exports =
|
|
|
|
getUndreadAnnouncements: (req, res, next)->
|
|
user_id = AuthenticationController.getLoggedInUserId(req)
|
|
logger.log {user_id}, "getting unread announcements"
|
|
AnnouncementsHandler.getUnreadAnnouncements user_id, (err, announcements)->
|
|
if err?
|
|
logger.err {err, user_id}, "unable to get unread announcements"
|
|
next(err)
|
|
else
|
|
res.json announcements
|
|
|
|
|
|
|
|
|
|
|