diff options
Diffstat (limited to 'server/models/utils.ts')
-rw-r--r-- | server/models/utils.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server/models/utils.ts b/server/models/utils.ts index 7ba96815e..1bf61d2a6 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts | |||
@@ -19,9 +19,17 @@ function addMethodsToModel (model: any, classMethods: Function[], instanceMethod | |||
19 | instanceMethods.forEach(m => model.prototype[m.name] = m) | 19 | instanceMethods.forEach(m => model.prototype[m.name] = m) |
20 | } | 20 | } |
21 | 21 | ||
22 | function getSortOnModel (model: any, value: string) { | ||
23 | let sort = getSort(value) | ||
24 | |||
25 | if (model) return [ { model: model }, sort[0], sort[1] ] | ||
26 | return sort | ||
27 | } | ||
28 | |||
22 | // --------------------------------------------------------------------------- | 29 | // --------------------------------------------------------------------------- |
23 | 30 | ||
24 | export { | 31 | export { |
25 | addMethodsToModel, | 32 | addMethodsToModel, |
26 | getSort | 33 | getSort, |
34 | getSortOnModel | ||
27 | } | 35 | } |