Fix video sort

This commit is contained in:
Chocobozzz 2018-12-18 11:52:20 +01:00
parent 276d965295
commit afa4374ab4
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 5 additions and 1 deletions

View File

@ -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' ]) {