1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Cleanup utils helper

This commit is contained in:
Chocobozzz 2018-08-14 15:28:30 +02:00
parent 59c76ffa8f
commit 06215f15e0
No known key found for this signature in database
GPG key ID: 583A612D890159BE
20 changed files with 173 additions and 166 deletions

View file

@ -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,