aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/me.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/me.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/me.ts')
-rw-r--r--server/controllers/api/users/me.ts5
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
28import { UserModel } from '../../../models/account/user' 28import { UserModel } from '../../../models/account/user'
29import { VideoModel } from '../../../models/video/video' 29import { VideoModel } from '../../../models/video/video'
30import { VideoImportModel } from '../../../models/video/video-import' 30import { VideoImportModel } from '../../../models/video/video-import'
31import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
31 32
32const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) 33const 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
168async function updateMe (req: express.Request, res: express.Response) { 169async 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
216async function updateMyAvatar (req: express.Request, res: express.Response) { 217async function updateMyAvatar (req: express.Request, res: express.Response) {