aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/utils.ts')
-rw-r--r--server/models/utils.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/models/utils.ts b/server/models/utils.ts
index 58a18c97a..eb6653f3d 100644
--- a/server/models/utils.ts
+++ b/server/models/utils.ts
@@ -1,6 +1,8 @@
1// Translate for example "-name" to [ [ 'name', 'DESC' ], [ 'id', 'ASC' ] ] 1// Translate for example "-name" to [ [ 'name', 'DESC' ], [ 'id', 'ASC' ] ]
2import { Sequelize } from 'sequelize-typescript' 2import { Sequelize } from 'sequelize-typescript'
3 3
4type SortType = { sortModel: any, sortValue: string }
5
4function getSort (value: string, lastSort: string[] = [ 'id', 'ASC' ]) { 6function getSort (value: string, lastSort: string[] = [ 'id', 'ASC' ]) {
5 let field: any 7 let field: any
6 let direction: 'ASC' | 'DESC' 8 let direction: 'ASC' | 'DESC'
@@ -54,6 +56,7 @@ function createSimilarityAttribute (col: string, value: string) {
54// --------------------------------------------------------------------------- 56// ---------------------------------------------------------------------------
55 57
56export { 58export {
59 SortType,
57 getSort, 60 getSort,
58 getSortOnModel, 61 getSortOnModel,
59 createSimilarityAttribute, 62 createSimilarityAttribute,