mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-27 15:59:22 +00:00
23 lines
465 B
TypeScript
23 lines
465 B
TypeScript
|
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())
|
||
|
});
|
||
|
}
|
||
|
|
||
|
}
|