diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-07 14:32:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 14:32:36 +0100 |
commit | 2d53be0267acc49cda46707b885096193a1f4e9c (patch) | |
tree | 887061a34bc67f40acbb96a6278f9544bf83caeb /server/controllers/api/users/my-notifications.ts | |
parent | adc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff) | |
download | PeerTube-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.ts | 7 |
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' |
20 | import { UserNotificationSetting } from '../../../../shared/models/users' | 20 | import { UserNotificationSetting } from '../../../../shared/models/users' |
21 | import { UserNotificationSettingModel } from '../../../models/account/user-notification-setting' | 21 | import { UserNotificationSettingModel } from '../../../models/account/user-notification-setting' |
22 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
22 | 23 | ||
23 | const myNotificationsRouter = express.Router() | 24 | const 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 | ||
90 | async function listUserNotifications (req: express.Request, res: express.Response) { | 91 | async 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 | ||
106 | async function markAsReadAllUserNotifications (req: express.Request, res: express.Response) { | 107 | async 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 | } |