aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/user-notification.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-18 11:28:17 +0200
committerChocobozzz <me@florianbigard.com>2019-04-24 16:26:20 +0200
commit1735c825726edaa0af5035cb6cbb0cc0db502c6d (patch)
tree7bbb442f2cb4d7be58a4e08d87f5974403a3047c /server/models/account/user-notification.ts
parente8bafea35bc930cb8ac5b2d521a188642a1adffe (diff)
downloadPeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.gz
PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.zst
PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.zip
Update sequelize
Diffstat (limited to 'server/models/account/user-notification.ts')
-rw-r--r--server/models/account/user-notification.ts23
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 @@
1import { 1import { 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'
15import { UserNotification, UserNotificationType } from '../../../shared' 2import { UserNotification, UserNotificationType } from '../../../shared'
16import { getSort, throwIfNotValid } from '../utils' 3import { getSort, throwIfNotValid } from '../utils'
17import { isBooleanValid } from '../../helpers/custom-validators/misc' 4import { isBooleanValid } from '../../helpers/custom-validators/misc'
@@ -19,7 +6,7 @@ import { isUserNotificationTypeValid } from '../../helpers/custom-validators/use
19import { UserModel } from './user' 6import { UserModel } from './user'
20import { VideoModel } from '../video/video' 7import { VideoModel } from '../video/video'
21import { VideoCommentModel } from '../video/video-comment' 8import { VideoCommentModel } from '../video/video-comment'
22import { Op } from 'sequelize' 9import { FindOptions, Op } from 'sequelize'
23import { VideoChannelModel } from '../video/video-channel' 10import { VideoChannelModel } from '../video/video-channel'
24import { AccountModel } from './account' 11import { AccountModel } from './account'
25import { VideoAbuseModel } from '../video/video-abuse' 12import { 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})
230export class UserNotificationModel extends Model<UserNotificationModel> { 217export 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),