fix change ownership typing

pull/2915/head
Rigel Kent 2020-06-28 22:45:25 +02:00
parent 4ee63ec648
commit b8b3abac6a
No known key found for this signature in database
GPG Key ID: 5E53E96A494E452F
2 changed files with 4 additions and 8 deletions

View File

@ -1,7 +1,7 @@
import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
import { PickWith } from '@shared/core-utils'
import { MAccountDefault, MAccountFormattable } from '../account/account'
import { MVideo, MVideoWithAllFiles } from './video'
import { MVideoWithAllFiles, MVideoFormattable } from './video'
type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
@ -23,4 +23,4 @@ export type MVideoChangeOwnershipFormattable =
Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
Use<'Initiator', MAccountFormattable> &
Use<'NextOwner', MAccountFormattable> &
Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>>
Use<'Video', MVideoFormattable>

View File

@ -1,16 +1,12 @@
import { Account } from '../actors'
import { Video } from './video.model'
export interface VideoChangeOwnership {
id: number
status: VideoChangeOwnershipStatus
initiatorAccount: Account
nextOwnerAccount: Account
video: {
id: number
name: string
uuid: string
url: string
}
video: Video
createdAt: Date
}