X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fshared%2Fabuses.ts;h=2c988f9ec57b8db0074c691f9b7a9287cf9f843e;hb=8ca52bcc2c37d457e8b19a237c66b8dd1c00b6b9;hp=4a20a55fae90ab3044334ce7815d90165f5a38e1;hpb=cf21b2cbef61929177b9c09b5e017c3b7eb8535d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/shared/abuses.ts b/server/middlewares/validators/shared/abuses.ts index 4a20a55fa..2c988f9ec 100644 --- a/server/middlewares/validators/shared/abuses.ts +++ b/server/middlewares/validators/shared/abuses.ts @@ -1,9 +1,10 @@ import { Response } from 'express' import { AbuseModel } from '@server/models/abuse/abuse' -import { HttpStatusCode } from '@shared/core-utils' +import { HttpStatusCode } from '@shared/models' +import { forceNumber } from '@shared/core-utils' async function doesAbuseExist (abuseId: number | string, res: Response) { - const abuse = await AbuseModel.loadByIdWithReporter(parseInt(abuseId + '', 10)) + const abuse = await AbuseModel.loadByIdWithReporter(forceNumber(abuseId)) if (!abuse) { res.fail({