diff options
Diffstat (limited to 'server/models/account/user-notification.ts')
-rw-r--r-- | server/models/account/user-notification.ts | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/server/models/account/user-notification.ts b/server/models/account/user-notification.ts index 33480f3b5..08388f268 100644 --- a/server/models/account/user-notification.ts +++ b/server/models/account/user-notification.ts | |||
@@ -1,17 +1,4 @@ | |||
1 | import { | 1 | import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' |
2 | AllowNull, | ||
3 | BelongsTo, | ||
4 | Column, | ||
5 | CreatedAt, | ||
6 | Default, | ||
7 | ForeignKey, | ||
8 | IFindOptions, | ||
9 | Is, | ||
10 | Model, | ||
11 | Scopes, | ||
12 | Table, | ||
13 | UpdatedAt | ||
14 | } from 'sequelize-typescript' | ||
15 | import { UserNotification, UserNotificationType } from '../../../shared' | 2 | import { UserNotification, UserNotificationType } from '../../../shared' |
16 | import { getSort, throwIfNotValid } from '../utils' | 3 | import { getSort, throwIfNotValid } from '../utils' |
17 | import { isBooleanValid } from '../../helpers/custom-validators/misc' | 4 | import { isBooleanValid } from '../../helpers/custom-validators/misc' |
@@ -19,7 +6,7 @@ import { isUserNotificationTypeValid } from '../../helpers/custom-validators/use | |||
19 | import { UserModel } from './user' | 6 | import { UserModel } from './user' |
20 | import { VideoModel } from '../video/video' | 7 | import { VideoModel } from '../video/video' |
21 | import { VideoCommentModel } from '../video/video-comment' | 8 | import { VideoCommentModel } from '../video/video-comment' |
22 | import { Op } from 'sequelize' | 9 | import { FindOptions, Op } from 'sequelize' |
23 | import { VideoChannelModel } from '../video/video-channel' | 10 | import { VideoChannelModel } from '../video/video-channel' |
24 | import { AccountModel } from './account' | 11 | import { AccountModel } from './account' |
25 | import { VideoAbuseModel } from '../video/video-abuse' | 12 | import { VideoAbuseModel } from '../video/video-abuse' |
@@ -160,7 +147,7 @@ function buildAccountInclude (required: boolean, withActor = false) { | |||
160 | }, | 147 | }, |
161 | 148 | ||
162 | buildAccountInclude(false, true) | 149 | buildAccountInclude(false, true) |
163 | ] | 150 | ] as any // FIXME: sequelize typings |
164 | } | 151 | } |
165 | }) | 152 | }) |
166 | @Table({ | 153 | @Table({ |
@@ -225,7 +212,7 @@ function buildAccountInclude (required: boolean, withActor = false) { | |||
225 | } | 212 | } |
226 | } | 213 | } |
227 | } | 214 | } |
228 | ] | 215 | ] as any // FIXME: sequelize typings |
229 | }) | 216 | }) |
230 | export class UserNotificationModel extends Model<UserNotificationModel> { | 217 | export class UserNotificationModel extends Model<UserNotificationModel> { |
231 | 218 | ||
@@ -344,7 +331,7 @@ export class UserNotificationModel extends Model<UserNotificationModel> { | |||
344 | ActorFollow: ActorFollowModel | 331 | ActorFollow: ActorFollowModel |
345 | 332 | ||
346 | static listForApi (userId: number, start: number, count: number, sort: string, unread?: boolean) { | 333 | static listForApi (userId: number, start: number, count: number, sort: string, unread?: boolean) { |
347 | const query: IFindOptions<UserNotificationModel> = { | 334 | const query: FindOptions = { |
348 | offset: start, | 335 | offset: start, |
349 | limit: count, | 336 | limit: count, |
350 | order: getSort(sort), | 337 | order: getSort(sort), |