diff options
Diffstat (limited to 'server/helpers/middlewares/abuses.ts')
-rw-r--r-- | server/helpers/middlewares/abuses.ts | 3 |
1 files changed, 2 insertions, 1 deletions
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 @@ | |||
1 | import { Response } from 'express' | 1 | import { Response } from 'express' |
2 | import { AbuseModel } from '../../models/abuse/abuse' | 2 | import { AbuseModel } from '../../models/abuse/abuse' |
3 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
3 | 4 | ||
4 | async function doesAbuseExist (abuseId: number | string, res: Response) { | 5 | async function doesAbuseExist (abuseId: number | string, res: Response) { |
5 | const abuse = await AbuseModel.loadByIdWithReporter(parseInt(abuseId + '', 10)) | 6 | const abuse = await AbuseModel.loadByIdWithReporter(parseInt(abuseId + '', 10)) |
6 | 7 | ||
7 | if (!abuse) { | 8 | if (!abuse) { |
8 | res.status(404) | 9 | res.status(HttpStatusCode.NOT_FOUND_404) |
9 | .json({ error: 'Abuse not found' }) | 10 | .json({ error: 'Abuse not found' }) |
10 | 11 | ||
11 | return false | 12 | return false |