aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/my-notifications.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-07 14:32:36 +0100
committerGitHub <noreply@github.com>2020-12-07 14:32:36 +0100
commit2d53be0267acc49cda46707b885096193a1f4e9c (patch)
tree887061a34bc67f40acbb96a6278f9544bf83caeb /server/controllers/api/users/my-notifications.ts
parentadc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff)
downloadPeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'server/controllers/api/users/my-notifications.ts')
-rw-r--r--server/controllers/api/users/my-notifications.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/api/users/my-notifications.ts b/server/controllers/api/users/my-notifications.ts
index 050866960..5f5e4c5e6 100644
--- a/server/controllers/api/users/my-notifications.ts
+++ b/server/controllers/api/users/my-notifications.ts
@@ -19,6 +19,7 @@ import {
19} from '../../../middlewares/validators/user-notifications' 19} from '../../../middlewares/validators/user-notifications'
20import { UserNotificationSetting } from '../../../../shared/models/users' 20import { UserNotificationSetting } from '../../../../shared/models/users'
21import { UserNotificationSettingModel } from '../../../models/account/user-notification-setting' 21import { UserNotificationSettingModel } from '../../../models/account/user-notification-setting'
22import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
22 23
23const myNotificationsRouter = express.Router() 24const myNotificationsRouter = express.Router()
24 25
@@ -84,7 +85,7 @@ async function updateNotificationSettings (req: express.Request, res: express.Re
84 85
85 await UserNotificationSettingModel.update(values, query) 86 await UserNotificationSettingModel.update(values, query)
86 87
87 return res.status(204).end() 88 return res.status(HttpStatusCode.NO_CONTENT_204).end()
88} 89}
89 90
90async function listUserNotifications (req: express.Request, res: express.Response) { 91async function listUserNotifications (req: express.Request, res: express.Response) {
@@ -100,7 +101,7 @@ async function markAsReadUserNotifications (req: express.Request, res: express.R
100 101
101 await UserNotificationModel.markAsRead(user.id, req.body.ids) 102 await UserNotificationModel.markAsRead(user.id, req.body.ids)
102 103
103 return res.status(204).end() 104 return res.status(HttpStatusCode.NO_CONTENT_204).end()
104} 105}
105 106
106async function markAsReadAllUserNotifications (req: express.Request, res: express.Response) { 107async function markAsReadAllUserNotifications (req: express.Request, res: express.Response) {
@@ -108,5 +109,5 @@ async function markAsReadAllUserNotifications (req: express.Request, res: expres
108 109
109 await UserNotificationModel.markAllAsRead(user.id) 110 await UserNotificationModel.markAllAsRead(user.id)
110 111
111 return res.status(204).end() 112 return res.status(HttpStatusCode.NO_CONTENT_204).end()
112} 113}