1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-27 15:59:22 +00:00
comunicapiv2/src/controllers/NotificationsController.ts

23 lines
465 B
TypeScript
Raw Normal View History

import { RequestHandler } from "../entities/RequestHandler";
import { NotificationsHelper } from "../helpers/NotificationsHelper";
/**
* Notifications controller
*
* @author Pierre HUBERT
*/
export class NotificationsController {
/**
* Get the number of unread notifications
*
* @param h Request handler
*/
public static async CountUnread(h: RequestHandler) {
h.send({
number: await NotificationsHelper.CountUnread(h.getUserId())
});
}
}