diff options
Diffstat (limited to 'server/models/utils.ts')
-rw-r--r-- | server/models/utils.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/models/utils.ts b/server/models/utils.ts index 6694eda69..5b4093aec 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts | |||
@@ -29,7 +29,11 @@ function getVideoSort (value: string, lastSort: string[] = [ 'id', 'ASC' ]) { | |||
29 | ] | 29 | ] |
30 | } | 30 | } |
31 | 31 | ||
32 | return [ field.split('.').concat([ direction ]), lastSort ] | 32 | const firstSort = typeof field === 'string' ? |
33 | field.split('.').concat([ direction ]) : | ||
34 | [ field, direction ] | ||
35 | |||
36 | return [ firstSort, lastSort ] | ||
33 | } | 37 | } |
34 | 38 | ||
35 | function getSortOnModel (model: any, value: string, lastSort: string[] = [ 'id', 'ASC' ]) { | 39 | function getSortOnModel (model: any, value: string, lastSort: string[] = [ 'id', 'ASC' ]) { |