aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-share.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video-share.ts')
-rw-r--r--server/models/video/video-share.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/models/video/video-share.ts b/server/models/video/video-share.ts
index fe5d56d42..37e405fa9 100644
--- a/server/models/video/video-share.ts
+++ b/server/models/video/video-share.ts
@@ -52,7 +52,7 @@ function associate (models) {
52 }) 52 })
53} 53}
54 54
55load = function (accountId: number, videoId: number) { 55load = function (accountId: number, videoId: number, t: Sequelize.Transaction) {
56 return VideoShare.findOne({ 56 return VideoShare.findOne({
57 where: { 57 where: {
58 accountId, 58 accountId,
@@ -60,11 +60,12 @@ load = function (accountId: number, videoId: number) {
60 }, 60 },
61 include: [ 61 include: [
62 VideoShare['sequelize'].models.Account 62 VideoShare['sequelize'].models.Account
63 ] 63 ],
64 transaction: t
64 }) 65 })
65} 66}
66 67
67loadAccountsByShare = function (videoId: number) { 68loadAccountsByShare = function (videoId: number, t: Sequelize.Transaction) {
68 const query = { 69 const query = {
69 where: { 70 where: {
70 videoId 71 videoId
@@ -74,7 +75,8 @@ loadAccountsByShare = function (videoId: number) {
74 model: VideoShare['sequelize'].models.Account, 75 model: VideoShare['sequelize'].models.Account,
75 required: true 76 required: true
76 } 77 }
77 ] 78 ],
79 transaction: t
78 } 80 }
79 81
80 return VideoShare.findAll(query) 82 return VideoShare.findAll(query)