X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fshared%2Fabuses.ts;h=2c988f9ec57b8db0074c691f9b7a9287cf9f843e;hb=8ca52bcc2c37d457e8b19a237c66b8dd1c00b6b9;hp=2b8d86ba519702141711fdfdeb804785159b26a9;hpb=ac27887774e63d99f4e227fbe18846f143cc4b3c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/shared/abuses.ts b/server/middlewares/validators/shared/abuses.ts index 2b8d86ba5..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/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({