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/abuse.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/abuse.ts')
-rw-r--r-- | server/controllers/api/abuse.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/api/abuse.ts b/server/controllers/api/abuse.ts index 25d6e2ab0..0ab74bdff 100644 --- a/server/controllers/api/abuse.ts +++ b/server/controllers/api/abuse.ts | |||
@@ -6,6 +6,7 @@ import { AbuseModel } from '@server/models/abuse/abuse' | |||
6 | import { AbuseMessageModel } from '@server/models/abuse/abuse-message' | 6 | import { AbuseMessageModel } from '@server/models/abuse/abuse-message' |
7 | import { getServerActor } from '@server/models/application/application' | 7 | import { getServerActor } from '@server/models/application/application' |
8 | import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' | 8 | import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' |
9 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | ||
9 | import { AbuseCreate, AbuseState, UserRight } from '../../../shared' | 10 | import { AbuseCreate, AbuseState, UserRight } from '../../../shared' |
10 | import { getFormattedObjects } from '../../helpers/utils' | 11 | import { getFormattedObjects } from '../../helpers/utils' |
11 | import { sequelizeTypescript } from '../../initializers/database' | 12 | import { sequelizeTypescript } from '../../initializers/database' |
@@ -141,7 +142,7 @@ async function updateAbuse (req: express.Request, res: express.Response) { | |||
141 | 142 | ||
142 | // Do not send the delete to other instances, we updated OUR copy of this abuse | 143 | // Do not send the delete to other instances, we updated OUR copy of this abuse |
143 | 144 | ||
144 | return res.sendStatus(204) | 145 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) |
145 | } | 146 | } |
146 | 147 | ||
147 | async function deleteAbuse (req: express.Request, res: express.Response) { | 148 | async function deleteAbuse (req: express.Request, res: express.Response) { |
@@ -153,7 +154,7 @@ async function deleteAbuse (req: express.Request, res: express.Response) { | |||
153 | 154 | ||
154 | // Do not send the delete to other instances, we delete OUR copy of this abuse | 155 | // Do not send the delete to other instances, we delete OUR copy of this abuse |
155 | 156 | ||
156 | return res.sendStatus(204) | 157 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) |
157 | } | 158 | } |
158 | 159 | ||
159 | async function reportAbuse (req: express.Request, res: express.Response) { | 160 | async function reportAbuse (req: express.Request, res: express.Response) { |
@@ -243,5 +244,5 @@ async function deleteAbuseMessage (req: express.Request, res: express.Response) | |||
243 | return abuseMessage.destroy({ transaction: t }) | 244 | return abuseMessage.destroy({ transaction: t }) |
244 | }) | 245 | }) |
245 | 246 | ||
246 | return res.sendStatus(204) | 247 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) |
247 | } | 248 | } |