1 import { Response } from 'express'
2 import { AbuseModel } from '../../models/abuse/abuse'
3 import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
5 async function doesAbuseExist (abuseId: number | string, res: Response) {
6 const abuse = await AbuseModel.loadByIdWithReporter(parseInt(abuseId + '', 10))
9 res.status(HttpStatusCode.NOT_FOUND_404)
10 .json({ error: 'Abuse not found' })
15 res.locals.abuse = abuse
19 // ---------------------------------------------------------------------------