From 2d53be0267acc49cda46707b885096193a1f4e9c Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 7 Dec 2020 14:32:36 +0100 Subject: replace numbers with typed http status codes (#3409) --- server/controllers/api/users/me.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/controllers/api/users/me.ts') 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 import { UserModel } from '../../../models/account/user' import { VideoModel } from '../../../models/video/video' import { VideoImportModel } from '../../../models/video/video-import' +import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) @@ -162,7 +163,7 @@ async function deleteMe (req: express.Request, res: express.Response) { await user.destroy() - return res.sendStatus(204) + return res.sendStatus(HttpStatusCode.NO_CONTENT_204) } async function updateMe (req: express.Request, res: express.Response) { @@ -210,7 +211,7 @@ async function updateMe (req: express.Request, res: express.Response) { await sendVerifyUserEmail(user, true) } - return res.sendStatus(204) + return res.sendStatus(HttpStatusCode.NO_CONTENT_204) } async function updateMyAvatar (req: express.Request, res: express.Response) { -- cgit v1.2.3