projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
276d965
)
Fix video sort
author
Chocobozzz
<me@florianbigard.com>
Tue, 18 Dec 2018 10:52:20 +0000
(11:52 +0100)
committer
Chocobozzz
<me@florianbigard.com>
Tue, 18 Dec 2018 10:52:20 +0000
(11:52 +0100)
server/models/utils.ts
patch
|
blob
|
history
diff --git
a/server/models/utils.ts
b/server/models/utils.ts
index 6694eda690b0570b0cd450decf3fbef5490539be..5b4093aec40d7b2aee217810c437da749b167afd 100644
(file)
--- a/
server/models/utils.ts
+++ b/
server/models/utils.ts
@@
-29,7
+29,11
@@
function getVideoSort (value: string, lastSort: string[] = [ 'id', 'ASC' ]) {
]
}
- return [ field.split('.').concat([ direction ]), lastSort ]
+ const firstSort = typeof field === 'string' ?
+ field.split('.').concat([ direction ]) :
+ [ field, direction ]
+
+ return [ firstSort, lastSort ]
}
function getSortOnModel (model: any, value: string, lastSort: string[] = [ 'id', 'ASC' ]) {