diff options
Diffstat (limited to 'server/models/video/video-change-ownership.ts')
-rw-r--r-- | server/models/video/video-change-ownership.ts | 11 |
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 @@ | |||
1 | import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' | 1 | import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' |
2 | import { AccountModel } from '../account/account' | 2 | import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' |
3 | import { ScopeNames as VideoScopeNames, VideoModel } from './video' | ||
4 | import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos' | 3 | import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos' |
4 | import { AccountModel } from '../account/account' | ||
5 | import { getSort } from '../utils' | 5 | import { getSort } from '../utils' |
6 | import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' | 6 | import { ScopeNames as VideoScopeNames, VideoModel } from './video' |
7 | import * as Bluebird from 'bluebird' | ||
8 | 7 | ||
9 | enum ScopeNames { | 8 | enum ScopeNames { |
10 | WITH_ACCOUNTS = 'WITH_ACCOUNTS', | 9 | WITH_ACCOUNTS = 'WITH_ACCOUNTS', |
@@ -54,7 +53,7 @@ enum ScopeNames { | |||
54 | ] | 53 | ] |
55 | } | 54 | } |
56 | })) | 55 | })) |
57 | export class VideoChangeOwnershipModel extends Model<VideoChangeOwnershipModel> { | 56 | export 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 | } |