diff options
Diffstat (limited to 'server/middlewares/validators/redundancy.ts')
-rw-r--r-- | server/middlewares/validators/redundancy.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/middlewares/validators/redundancy.ts b/server/middlewares/validators/redundancy.ts index 79460f63c..c80f9b728 100644 --- a/server/middlewares/validators/redundancy.ts +++ b/server/middlewares/validators/redundancy.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { body, param, query } from 'express-validator' | 2 | import { body, param, query } from 'express-validator' |
3 | import { isVideoRedundancyTarget } from '@server/helpers/custom-validators/video-redundancies' | 3 | import { isVideoRedundancyTarget } from '@server/helpers/custom-validators/video-redundancies' |
4 | import { forceNumber } from '@shared/core-utils' | ||
4 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 5 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
5 | import { | 6 | import { |
6 | exists, | 7 | exists, |
@@ -171,7 +172,7 @@ const removeVideoRedundancyValidator = [ | |||
171 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 172 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
172 | if (areValidationErrors(req, res)) return | 173 | if (areValidationErrors(req, res)) return |
173 | 174 | ||
174 | const redundancy = await VideoRedundancyModel.loadByIdWithVideo(parseInt(req.params.redundancyId, 10)) | 175 | const redundancy = await VideoRedundancyModel.loadByIdWithVideo(forceNumber(req.params.redundancyId)) |
175 | if (!redundancy) { | 176 | if (!redundancy) { |
176 | return res.fail({ | 177 | return res.fail({ |
177 | status: HttpStatusCode.NOT_FOUND_404, | 178 | status: HttpStatusCode.NOT_FOUND_404, |