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/helpers/middlewares/abuses.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/helpers/middlewares/abuses.ts') diff --git a/server/helpers/middlewares/abuses.ts b/server/helpers/middlewares/abuses.ts index 59ba0d3ed..c53bd9efd 100644 --- a/server/helpers/middlewares/abuses.ts +++ b/server/helpers/middlewares/abuses.ts @@ -1,11 +1,12 @@ import { Response } from 'express' import { AbuseModel } from '../../models/abuse/abuse' +import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' async function doesAbuseExist (abuseId: number | string, res: Response) { const abuse = await AbuseModel.loadByIdWithReporter(parseInt(abuseId + '', 10)) if (!abuse) { - res.status(404) + res.status(HttpStatusCode.NOT_FOUND_404) .json({ error: 'Abuse not found' }) return false -- cgit v1.2.3