diff options
Diffstat (limited to 'server/models/utils.ts')
-rw-r--r-- | server/models/utils.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/models/utils.ts b/server/models/utils.ts index 0950f5f32..66b653e3d 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts | |||
@@ -1,5 +1,4 @@ | |||
1 | import { literal, Op, OrderItem, Sequelize } from 'sequelize' | 1 | import { literal, Op, OrderItem, Sequelize } from 'sequelize' |
2 | import { Col } from 'sequelize/types/utils' | ||
3 | import validator from 'validator' | 2 | import validator from 'validator' |
4 | 3 | ||
5 | type SortType = { sortModel: string, sortValue: string } | 4 | type SortType = { sortModel: string, sortValue: string } |
@@ -8,7 +7,7 @@ type SortType = { sortModel: string, sortValue: string } | |||
8 | function getSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]): OrderItem[] { | 7 | function getSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]): OrderItem[] { |
9 | const { direction, field } = buildDirectionAndField(value) | 8 | const { direction, field } = buildDirectionAndField(value) |
10 | 9 | ||
11 | let finalField: string | Col | 10 | let finalField: string | ReturnType<typeof Sequelize.col> |
12 | 11 | ||
13 | if (field.toLowerCase() === 'match') { // Search | 12 | if (field.toLowerCase() === 'match') { // Search |
14 | finalField = Sequelize.col('similarity') | 13 | finalField = Sequelize.col('similarity') |
@@ -65,7 +64,7 @@ function getVideoSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]): Or | |||
65 | ] | 64 | ] |
66 | } | 65 | } |
67 | 66 | ||
68 | let finalField: string | Col | 67 | let finalField: string | ReturnType<typeof Sequelize.col> |
69 | 68 | ||
70 | // Alias | 69 | // Alias |
71 | if (field.toLowerCase() === 'match') { // Search | 70 | if (field.toLowerCase() === 'match') { // Search |