diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-05 13:26:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-05 14:14:16 +0200 |
commit | 6fcd19ba737f1f5614a56c6925adb882dea43b8d (patch) | |
tree | 3365a96d82bc7f00ae504a568725c8e914150cf8 /server/models/user/user-video-rate.ts | |
parent | 5fe7e898316e18369c3e1aba307b55077adc7bfb (diff) | |
download | PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.tar.gz PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.tar.zst PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.zip |
Move to promises
Closes https://github.com/Chocobozzz/PeerTube/issues/74
Diffstat (limited to 'server/models/user/user-video-rate.ts')
-rw-r--r-- | server/models/user/user-video-rate.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/models/user/user-video-rate.ts b/server/models/user/user-video-rate.ts index 4bdd35bc9..37d0222cf 100644 --- a/server/models/user/user-video-rate.ts +++ b/server/models/user/user-video-rate.ts | |||
@@ -8,7 +8,6 @@ import { VIDEO_RATE_TYPES } from '../../initializers' | |||
8 | 8 | ||
9 | import { addMethodsToModel } from '../utils' | 9 | import { addMethodsToModel } from '../utils' |
10 | import { | 10 | import { |
11 | UserVideoRateClass, | ||
12 | UserVideoRateInstance, | 11 | UserVideoRateInstance, |
13 | UserVideoRateAttributes, | 12 | UserVideoRateAttributes, |
14 | 13 | ||
@@ -66,7 +65,7 @@ function associate (models) { | |||
66 | }) | 65 | }) |
67 | } | 66 | } |
68 | 67 | ||
69 | load = function (userId: number, videoId: string, transaction: Sequelize.Transaction, callback: UserVideoRateMethods.LoadCallback) { | 68 | load = function (userId: number, videoId: string, transaction: Sequelize.Transaction) { |
70 | const options: Sequelize.FindOptions = { | 69 | const options: Sequelize.FindOptions = { |
71 | where: { | 70 | where: { |
72 | userId, | 71 | userId, |
@@ -75,5 +74,5 @@ load = function (userId: number, videoId: string, transaction: Sequelize.Transac | |||
75 | } | 74 | } |
76 | if (transaction) options.transaction = transaction | 75 | if (transaction) options.transaction = transaction |
77 | 76 | ||
78 | return UserVideoRate.findOne(options).asCallback(callback) | 77 | return UserVideoRate.findOne(options) |
79 | } | 78 | } |