X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fshared%2Fabuses.ts;h=2c988f9ec57b8db0074c691f9b7a9287cf9f843e;hb=4638cd713dcdd007cd7f49b9a95fa62ac7823e7c;hp=2b8d86ba519702141711fdfdeb804785159b26a9;hpb=c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea;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({