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/me.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/me.ts')
-rw-r--r-- | server/controllers/api/users/me.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index b490518fc..3d2a325fe 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts | |||
@@ -28,6 +28,7 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat | |||
28 | import { UserModel } from '../../../models/account/user' | 28 | import { UserModel } from '../../../models/account/user' |
29 | import { VideoModel } from '../../../models/video/video' | 29 | import { VideoModel } from '../../../models/video/video' |
30 | import { VideoImportModel } from '../../../models/video/video-import' | 30 | import { VideoImportModel } from '../../../models/video/video-import' |
31 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
31 | 32 | ||
32 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) | 33 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) |
33 | 34 | ||
@@ -162,7 +163,7 @@ async function deleteMe (req: express.Request, res: express.Response) { | |||
162 | 163 | ||
163 | await user.destroy() | 164 | await user.destroy() |
164 | 165 | ||
165 | return res.sendStatus(204) | 166 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) |
166 | } | 167 | } |
167 | 168 | ||
168 | async function updateMe (req: express.Request, res: express.Response) { | 169 | async function updateMe (req: express.Request, res: express.Response) { |
@@ -210,7 +211,7 @@ async function updateMe (req: express.Request, res: express.Response) { | |||
210 | await sendVerifyUserEmail(user, true) | 211 | await sendVerifyUserEmail(user, true) |
211 | } | 212 | } |
212 | 213 | ||
213 | return res.sendStatus(204) | 214 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) |
214 | } | 215 | } |
215 | 216 | ||
216 | async function updateMyAvatar (req: express.Request, res: express.Response) { | 217 | async function updateMyAvatar (req: express.Request, res: express.Response) { |