aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-change-ownership.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video-change-ownership.ts')
-rw-r--r--server/models/video/video-change-ownership.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/models/video/video-change-ownership.ts b/server/models/video/video-change-ownership.ts
index ac0ab7e8b..298e8bfe2 100644
--- a/server/models/video/video-change-ownership.ts
+++ b/server/models/video/video-change-ownership.ts
@@ -1,10 +1,9 @@
1import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' 1import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'
2import { AccountModel } from '../account/account' 2import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership'
3import { ScopeNames as VideoScopeNames, VideoModel } from './video'
4import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos' 3import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos'
4import { AccountModel } from '../account/account'
5import { getSort } from '../utils' 5import { getSort } from '../utils'
6import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' 6import { ScopeNames as VideoScopeNames, VideoModel } from './video'
7import * as Bluebird from 'bluebird'
8 7
9enum ScopeNames { 8enum ScopeNames {
10 WITH_ACCOUNTS = 'WITH_ACCOUNTS', 9 WITH_ACCOUNTS = 'WITH_ACCOUNTS',
@@ -54,7 +53,7 @@ enum ScopeNames {
54 ] 53 ]
55 } 54 }
56})) 55}))
57export class VideoChangeOwnershipModel extends Model<VideoChangeOwnershipModel> { 56export class VideoChangeOwnershipModel extends Model {
58 @CreatedAt 57 @CreatedAt
59 createdAt: Date 58 createdAt: Date
60 59
@@ -119,7 +118,7 @@ export class VideoChangeOwnershipModel extends Model<VideoChangeOwnershipModel>
119 ]).then(([ count, rows ]) => ({ total: count, data: rows })) 118 ]).then(([ count, rows ]) => ({ total: count, data: rows }))
120 } 119 }
121 120
122 static load (id: number): Bluebird<MVideoChangeOwnershipFull> { 121 static load (id: number): Promise<MVideoChangeOwnershipFull> {
123 return VideoChangeOwnershipModel.scope([ ScopeNames.WITH_ACCOUNTS, ScopeNames.WITH_VIDEO ]) 122 return VideoChangeOwnershipModel.scope([ ScopeNames.WITH_ACCOUNTS, ScopeNames.WITH_VIDEO ])
124 .findByPk(id) 123 .findByPk(id)
125 } 124 }