2018-03-30 15:30:30 -04:00
|
|
|
import {UserRoles} from '../../common/entities/UserDTO';
|
|
|
|
import {AuthenticationMWs} from '../middlewares/user/AuthenticationMWs';
|
|
|
|
import {RenderingMWs} from '../middlewares/RenderingMWs';
|
|
|
|
import {NotificationMWs} from '../middlewares/NotificationMWs';
|
2018-11-28 23:49:33 +01:00
|
|
|
import {Express} from 'express';
|
2019-02-15 11:47:09 -05:00
|
|
|
import {VersionMWs} from '../middlewares/VersionMWs';
|
2017-07-09 14:23:50 +02:00
|
|
|
|
|
|
|
export class NotificationRouter {
|
2018-11-28 23:49:33 +01:00
|
|
|
public static route(app: Express) {
|
2017-07-09 14:23:50 +02:00
|
|
|
|
|
|
|
this.addGetNotifications(app);
|
|
|
|
}
|
|
|
|
|
2018-11-28 23:49:33 +01:00
|
|
|
private static addGetNotifications(app: Express) {
|
2018-03-30 15:30:30 -04:00
|
|
|
app.get('/api/notifications',
|
2017-07-09 14:23:50 +02:00
|
|
|
AuthenticationMWs.authenticate,
|
|
|
|
AuthenticationMWs.authorise(UserRoles.Guest),
|
2019-02-15 11:47:09 -05:00
|
|
|
VersionMWs.injectGalleryVersion,
|
2017-07-09 14:23:50 +02:00
|
|
|
NotificationMWs.list,
|
|
|
|
RenderingMWs.renderResult
|
|
|
|
);
|
2018-03-30 15:30:30 -04:00
|
|
|
}
|
2017-07-09 14:23:50 +02:00
|
|
|
|
|
|
|
}
|