diff options
Diffstat (limited to 'server/models/video/video-channel-share.ts')
-rw-r--r-- | server/models/video/video-channel-share.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/server/models/video/video-channel-share.ts b/server/models/video/video-channel-share.ts index e47c0dae7..2e9b658a3 100644 --- a/server/models/video/video-channel-share.ts +++ b/server/models/video/video-channel-share.ts | |||
@@ -52,7 +52,7 @@ function associate (models) { | |||
52 | }) | 52 | }) |
53 | } | 53 | } |
54 | 54 | ||
55 | load = function (accountId: number, videoChannelId: number) { | 55 | load = function (accountId: number, videoChannelId: number, t: Sequelize.Transaction) { |
56 | return VideoChannelShare.findOne({ | 56 | return VideoChannelShare.findOne({ |
57 | where: { | 57 | where: { |
58 | accountId, | 58 | accountId, |
@@ -61,11 +61,12 @@ load = function (accountId: number, videoChannelId: number) { | |||
61 | include: [ | 61 | include: [ |
62 | VideoChannelShare['sequelize'].models.Account, | 62 | VideoChannelShare['sequelize'].models.Account, |
63 | VideoChannelShare['sequelize'].models.VideoChannel | 63 | VideoChannelShare['sequelize'].models.VideoChannel |
64 | ] | 64 | ], |
65 | transaction: t | ||
65 | }) | 66 | }) |
66 | } | 67 | } |
67 | 68 | ||
68 | loadAccountsByShare = function (videoChannelId: number) { | 69 | loadAccountsByShare = function (videoChannelId: number, t: Sequelize.Transaction) { |
69 | const query = { | 70 | const query = { |
70 | where: { | 71 | where: { |
71 | videoChannelId | 72 | videoChannelId |
@@ -75,7 +76,8 @@ loadAccountsByShare = function (videoChannelId: number) { | |||
75 | model: VideoChannelShare['sequelize'].models.Account, | 76 | model: VideoChannelShare['sequelize'].models.Account, |
76 | required: true | 77 | required: true |
77 | } | 78 | } |
78 | ] | 79 | ], |
80 | transaction: t | ||
79 | } | 81 | } |
80 | 82 | ||
81 | return VideoChannelShare.findAll(query) | 83 | return VideoChannelShare.findAll(query) |