aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-09 17:48:15 +0100
committerChocobozzz <me@florianbigard.com>2022-02-09 17:48:15 +0100
commit9d8ef212ff46cc1b96dc407a85e7486f185c5179 (patch)
tree61fd2a1a03f84d5fefc6f257fc358b637c791a24 /server/models/utils.ts
parent57a9b61a4aeead74e8800bbfad82ef433313b204 (diff)
downloadPeerTube-9d8ef212ff46cc1b96dc407a85e7486f185c5179.tar.gz
PeerTube-9d8ef212ff46cc1b96dc407a85e7486f185c5179.tar.zst
PeerTube-9d8ef212ff46cc1b96dc407a85e7486f185c5179.zip
Fix broken dep
Diffstat (limited to 'server/models/utils.ts')
-rw-r--r--server/models/utils.ts5
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 @@
1import { literal, Op, OrderItem, Sequelize } from 'sequelize' 1import { literal, Op, OrderItem, Sequelize } from 'sequelize'
2import { Col } from 'sequelize/types/utils'
3import validator from 'validator' 2import validator from 'validator'
4 3
5type SortType = { sortModel: string, sortValue: string } 4type SortType = { sortModel: string, sortValue: string }
@@ -8,7 +7,7 @@ type SortType = { sortModel: string, sortValue: string }
8function getSort (value: string, lastSort: OrderItem = [ 'id', 'ASC' ]): OrderItem[] { 7function 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