Fix deleting a video with comments
This commit is contained in:
parent
d6bd50ba1d
commit
29c6b82944
|
@ -188,6 +188,27 @@ export class VideoCommentModel extends Model<VideoCommentModel> {
|
||||||
}) as AccountModel
|
}) as AccountModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!instance.Video) {
|
||||||
|
instance.Video = await instance.$get('Video', {
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
model: VideoChannelModel,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
model: AccountModel,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
model: ActorModel
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
transaction: options.transaction
|
||||||
|
}) as VideoModel
|
||||||
|
}
|
||||||
|
|
||||||
if (instance.isOwned()) {
|
if (instance.isOwned()) {
|
||||||
await sendDeleteVideoComment(instance, options.transaction)
|
await sendDeleteVideoComment(instance, options.transaction)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue