diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/utils.ts | 3 | ||||
-rw-r--r-- | server/models/video/video-blacklist.ts | 6 |
2 files changed, 6 insertions, 3 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' ] ] |
2 | import { Sequelize } from 'sequelize-typescript' | 2 | import { Sequelize } from 'sequelize-typescript' |
3 | 3 | ||
4 | type SortType = { sortModel: any, sortValue: string } | ||
5 | |||
4 | function getSort (value: string, lastSort: string[] = [ 'id', 'ASC' ]) { | 6 | function 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 | ||
56 | export { | 58 | export { |
59 | SortType, | ||
57 | getSort, | 60 | getSort, |
58 | getSortOnModel, | 61 | getSortOnModel, |
59 | createSimilarityAttribute, | 62 | createSimilarityAttribute, |
diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index eabc37ef0..67f7cd487 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts | |||
@@ -4,15 +4,15 @@ import { | |||
4 | AllowNull, | 4 | AllowNull, |
5 | BelongsTo, | 5 | BelongsTo, |
6 | Column, | 6 | Column, |
7 | CreatedAt, DataType, | 7 | CreatedAt, |
8 | DataType, | ||
8 | ForeignKey, | 9 | ForeignKey, |
9 | Is, | 10 | Is, |
10 | Model, | 11 | Model, |
11 | Table, | 12 | Table, |
12 | UpdatedAt | 13 | UpdatedAt |
13 | } from 'sequelize-typescript' | 14 | } from 'sequelize-typescript' |
14 | import { SortType } from '../../helpers/utils' | 15 | import { getSortOnModel, SortType, throwIfNotValid } from '../utils' |
15 | import { getSortOnModel, throwIfNotValid } from '../utils' | ||
16 | import { VideoModel } from './video' | 16 | import { VideoModel } from './video' |
17 | import { isVideoBlacklistReasonValid } from '../../helpers/custom-validators/video-blacklist' | 17 | import { isVideoBlacklistReasonValid } from '../../helpers/custom-validators/video-blacklist' |
18 | import { Emailer } from '../../lib/emailer' | 18 | import { Emailer } from '../../lib/emailer' |