From 06215f15e0a9fea2ef95b8b49cb2b5868fb64017 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 14 Aug 2018 15:28:30 +0200 Subject: Cleanup utils helper --- server/models/utils.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/models/utils.ts') 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 @@ // Translate for example "-name" to [ [ 'name', 'DESC' ], [ 'id', 'ASC' ] ] import { Sequelize } from 'sequelize-typescript' +type SortType = { sortModel: any, sortValue: string } + function getSort (value: string, lastSort: string[] = [ 'id', 'ASC' ]) { let field: any let direction: 'ASC' | 'DESC' @@ -54,6 +56,7 @@ function createSimilarityAttribute (col: string, value: string) { // --------------------------------------------------------------------------- export { + SortType, getSort, getSortOnModel, createSimilarityAttribute, -- cgit v1.2.3