X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fabuse%2Fabuse-query-builder.ts;h=74f4542e55259ff20a47e94bb1e080de3f094ced;hb=0a8a79552cf59c800011c9f63eaa8658230acddc;hp=025e6ba5532320e01d4bd2420265af413037e007;hpb=82b9a1005cd5f5d3c338270839a24f217594b35d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/abuse/abuse-query-builder.ts b/server/models/abuse/abuse-query-builder.ts index 025e6ba55..74f4542e5 100644 --- a/server/models/abuse/abuse-query-builder.ts +++ b/server/models/abuse/abuse-query-builder.ts @@ -1,5 +1,6 @@ import { exists } from '@server/helpers/custom-validators/misc' +import { forceNumber } from '@shared/core-utils' import { AbuseFilter, AbuseState, AbuseVideoIs } from '@shared/models' import { buildBlockedAccountSQL, buildDirectionAndField } from '../utils' @@ -13,7 +14,7 @@ export type BuildAbusesQueryOptions = { searchReporter?: string searchReportee?: string - // video releated + // video related searchVideo?: string searchVideoChannel?: string videoIs?: AbuseVideoIs @@ -135,12 +136,12 @@ function buildAbuseListQuery (options: BuildAbusesQueryOptions, type: 'count' | } if (exists(options.count)) { - const count = parseInt(options.count + '', 10) + const count = forceNumber(options.count) suffix += `LIMIT ${count} ` } if (exists(options.start)) { - const start = parseInt(options.start + '', 10) + const start = forceNumber(options.start) suffix += `OFFSET ${start} ` } }