@@ -17,56 +17,54 @@ import { UserModel } from "../../models/UserModel";
1717
1818@JsonController ( "notif/" )
1919export class NotifController {
20- private notifService : NotifService ;
20+ private notifService : NotifService ;
2121
22- constructor ( notifService : NotifService ) {
23- this . notifService = notifService ;
24- }
22+ constructor ( notifService : NotifService ) {
23+ this . notifService = notifService ;
24+ }
2525
26- @Get ( " recent" )
27- async getRecentNotifications ( @CurrentUser ( ) user : UserModel ) {
28- return this . notifService . getRecentNotifications ( user . firebaseUid ) ;
29- }
26+ @Get ( ' recent' )
27+ async getRecentNotifications ( @CurrentUser ( ) user : UserModel ) {
28+ return this . notifService . getRecentNotifications ( user . firebaseUid ) ;
29+ }
3030
31- @Get ( " new" )
32- async getUnread ( @CurrentUser ( ) user : UserModel ) {
33- return this . notifService . getUnreadNotifications ( user . firebaseUid ) ;
34- }
31+ @Get ( ' new' )
32+ async getUnread ( @CurrentUser ( ) user : UserModel ) {
33+ return this . notifService . getUnreadNotifications ( user . firebaseUid ) ;
34+ }
3535
36- @Get ( " last7days" )
37- getLast7Days ( @CurrentUser ( ) user : UserModel ) {
38- return this . notifService . getNotificationsLast7Days ( user . firebaseUid ) ;
39- }
36+ @Get ( ' last7days' )
37+ getLast7Days ( @CurrentUser ( ) user : UserModel ) {
38+ return this . notifService . getNotificationsLast7Days ( user . firebaseUid ) ;
39+ }
4040
41- @Get ( " last30days" )
42- getLast30Days ( @CurrentUser ( ) user : UserModel ) {
43- return this . notifService . getNotificationsLast30Days ( user . firebaseUid ) ;
44- }
41+ @Get ( ' last30days' )
42+ getLast30Days ( @CurrentUser ( ) user : UserModel ) {
43+ return this . notifService . getNotificationsLast30Days ( user . firebaseUid ) ;
44+ }
4545
46- @Post ( )
47- async sendNotif ( @Body ( ) findTokensRequest : FindTokensRequest ) {
48- return this . notifService . sendNotifs ( findTokensRequest ) ;
49- }
46+ @Post ( )
47+ async sendNotif ( @Body ( ) findTokensRequest : FindTokensRequest ) {
48+ return this . notifService . sendNotifs ( findTokensRequest ) ;
49+ }
5050
51- @Post ( "discount" )
52- async sendDiscountNotif (
53- @Body ( ) discountRequest : DiscountNotificationRequest ,
54- ) {
55- return this . notifService . sendDiscountNotification ( discountRequest ) ;
56- }
51+ @Post ( 'discount' )
52+ async sendDiscountNotif ( @Body ( ) discountRequest : DiscountNotificationRequest ) {
53+ return this . notifService . sendDiscountNotification ( discountRequest ) ;
54+ }
5755
58- @Post ( "request-match" )
59- async sendRequestMatchNotif (
60- @Body ( ) matchRequest : RequestMatchNotificationRequest ,
61- ) {
62- return this . notifService . sendRequestMatchNotification ( matchRequest ) ;
63- }
56+ @Post ( 'request-match' )
57+ async sendRequestMatchNotif ( @Body ( ) matchRequest : RequestMatchNotificationRequest ) {
58+ return this . notifService . sendRequestMatchNotification ( matchRequest ) ;
59+ }
6460
65- @Delete ( "id/:id" )
66- async deleteNotification (
67- @CurrentUser ( ) user : UserModel ,
68- @Params ( ) params : { id : string } ,
69- ) {
70- return this . notifService . deleteNotification ( user . firebaseUid , params . id ) ;
71- }
61+ @Post ( 'markAsRead/id/:id' )
62+ async markAsRead ( @CurrentUser ( ) user : UserModel , @Params ( ) params : { id : string } ) {
63+ return this . notifService . markAsRead ( user . firebaseUid , params . id ) ;
64+ }
65+
66+ @Delete ( 'id/:id' )
67+ async deleteNotification ( @CurrentUser ( ) user : UserModel , @Params ( ) params : { id : string } ) {
68+ return this . notifService . deleteNotification ( user . firebaseUid , params . id ) ;
69+ }
7270}
0 commit comments