Add language filters in user preferences

This commit is contained in:
Chocobozzz 2019-06-19 14:55:58 +02:00
parent bbe078ba55
commit 3caf77d3b1
No known key found for this signature in database
GPG key ID: 583A612D890159BE
24 changed files with 443 additions and 150 deletions

View file

@ -1,7 +1,7 @@
import { Sequelize } from 'sequelize-typescript'
import { Model, Sequelize } from 'sequelize-typescript'
import * as validator from 'validator'
import { OrderItem } from 'sequelize'
import { Col } from 'sequelize/types/lib/utils'
import { OrderItem } from 'sequelize/types'
type SortType = { sortModel: any, sortValue: string }
@ -127,6 +127,11 @@ function parseAggregateResult (result: any) {
return total
}
const createSafeIn = (model: typeof Model, stringArr: string[]) => {
return stringArr.map(t => model.sequelize.escape(t))
.join(', ')
}
// ---------------------------------------------------------------------------
export {
@ -141,7 +146,8 @@ export {
buildTrigramSearchIndex,
buildWhereIdOrUUID,
isOutdated,
parseAggregateResult
parseAggregateResult,
createSafeIn
}
// ---------------------------------------------------------------------------