diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-08-25 18:36:49 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-08-25 18:36:49 +0200 |
commit | 556ddc319242aafef51bae9301423ecf8701a3af (patch) | |
tree | 413829b522193584df348f0356a702b3222c3419 /server/models/user | |
parent | d15ab38a905e6b50972e6f884917db9198279daf (diff) | |
download | PeerTube-556ddc319242aafef51bae9301423ecf8701a3af.tar.gz PeerTube-556ddc319242aafef51bae9301423ecf8701a3af.tar.zst PeerTube-556ddc319242aafef51bae9301423ecf8701a3af.zip |
Upgrade common server dependencies
Diffstat (limited to 'server/models/user')
-rw-r--r-- | server/models/user/user-video-rate-interface.ts | 2 | ||||
-rw-r--r-- | server/models/user/user-video-rate.ts | 2 | ||||
-rw-r--r-- | server/models/user/user.ts | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/server/models/user/user-video-rate-interface.ts b/server/models/user/user-video-rate-interface.ts index 4e6efc01a..ea0fdc4d9 100644 --- a/server/models/user/user-video-rate-interface.ts +++ b/server/models/user/user-video-rate-interface.ts | |||
@@ -13,6 +13,8 @@ export interface UserVideoRateClass { | |||
13 | 13 | ||
14 | export interface UserVideoRateAttributes { | 14 | export interface UserVideoRateAttributes { |
15 | type: VideoRateType | 15 | type: VideoRateType |
16 | userId: number | ||
17 | videoId: number | ||
16 | } | 18 | } |
17 | 19 | ||
18 | export interface UserVideoRateInstance extends UserVideoRateClass, UserVideoRateAttributes, Sequelize.Instance<UserVideoRateAttributes> { | 20 | export interface UserVideoRateInstance extends UserVideoRateClass, UserVideoRateAttributes, Sequelize.Instance<UserVideoRateAttributes> { |
diff --git a/server/models/user/user-video-rate.ts b/server/models/user/user-video-rate.ts index c14598650..7d6dd7281 100644 --- a/server/models/user/user-video-rate.ts +++ b/server/models/user/user-video-rate.ts | |||
@@ -66,7 +66,7 @@ function associate (models) { | |||
66 | } | 66 | } |
67 | 67 | ||
68 | load = function (userId: number, videoId: number, transaction: Sequelize.Transaction) { | 68 | load = function (userId: number, videoId: number, transaction: Sequelize.Transaction) { |
69 | const options: Sequelize.FindOptions = { | 69 | const options: Sequelize.FindOptions<UserVideoRateAttributes> = { |
70 | where: { | 70 | where: { |
71 | userId, | 71 | userId, |
72 | videoId | 72 | videoId |
diff --git a/server/models/user/user.ts b/server/models/user/user.ts index e1b933988..d481fa13c 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts | |||
@@ -198,7 +198,7 @@ loadById = function (id: number) { | |||
198 | loadByUsername = function (username: string) { | 198 | loadByUsername = function (username: string) { |
199 | const query = { | 199 | const query = { |
200 | where: { | 200 | where: { |
201 | username: username | 201 | username |
202 | } | 202 | } |
203 | } | 203 | } |
204 | 204 | ||
@@ -212,5 +212,6 @@ loadByUsernameOrEmail = function (username: string, email: string) { | |||
212 | } | 212 | } |
213 | } | 213 | } |
214 | 214 | ||
215 | return User.findOne(query) | 215 | // FIXME: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18387 |
216 | return (User as any).findOne(query) | ||
216 | } | 217 | } |