diff options
author | Chocobozzz <me@florianbigard.com> | 2023-01-10 11:09:30 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-01-10 11:56:08 +0100 |
commit | 8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa (patch) | |
tree | 4e7d3711cccb095d4356c59554bdfd4e16502832 /server/models/abuse/sql/abuse-query-builder.ts | |
parent | a8749f7c3b137f433e6944bb99fd721a6f0cfc1e (diff) | |
download | PeerTube-8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa.tar.gz PeerTube-8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa.tar.zst PeerTube-8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa.zip |
Refactor model utils
Diffstat (limited to 'server/models/abuse/sql/abuse-query-builder.ts')
-rw-r--r-- | server/models/abuse/sql/abuse-query-builder.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/models/abuse/sql/abuse-query-builder.ts b/server/models/abuse/sql/abuse-query-builder.ts index 854f0cda8..282d4541a 100644 --- a/server/models/abuse/sql/abuse-query-builder.ts +++ b/server/models/abuse/sql/abuse-query-builder.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | import { exists } from '@server/helpers/custom-validators/misc' | 2 | import { exists } from '@server/helpers/custom-validators/misc' |
3 | import { forceNumber } from '@shared/core-utils' | 3 | import { forceNumber } from '@shared/core-utils' |
4 | import { AbuseFilter, AbuseState, AbuseVideoIs } from '@shared/models' | 4 | import { AbuseFilter, AbuseState, AbuseVideoIs } from '@shared/models' |
5 | import { buildBlockedAccountSQL, buildDirectionAndField } from '../../utils' | 5 | import { buildBlockedAccountSQL, buildSortDirectionAndField } from '../../shared' |
6 | 6 | ||
7 | export type BuildAbusesQueryOptions = { | 7 | export type BuildAbusesQueryOptions = { |
8 | start: number | 8 | start: number |
@@ -157,7 +157,7 @@ function buildAbuseListQuery (options: BuildAbusesQueryOptions, type: 'count' | | |||
157 | } | 157 | } |
158 | 158 | ||
159 | function buildAbuseOrder (value: string) { | 159 | function buildAbuseOrder (value: string) { |
160 | const { direction, field } = buildDirectionAndField(value) | 160 | const { direction, field } = buildSortDirectionAndField(value) |
161 | 161 | ||
162 | return `ORDER BY "abuse"."${field}" ${direction}` | 162 | return `ORDER BY "abuse"."${field}" ${direction}` |
163 | } | 163 | } |