diff options
author | Chocobozzz <me@florianbigard.com> | 2019-02-21 14:28:06 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-02-21 14:40:10 +0100 |
commit | 9b39106d5757caf221a88e42e05167a6fac479c6 (patch) | |
tree | ce3ac7907135d82ad13abf648eff4f963448227e /server/models/account | |
parent | 374c1db98cf22527f5b362c70d3c50e3be4c8885 (diff) | |
download | PeerTube-9b39106d5757caf221a88e42e05167a6fac479c6.tar.gz PeerTube-9b39106d5757caf221a88e42e05167a6fac479c6.tar.zst PeerTube-9b39106d5757caf221a88e42e05167a6fac479c6.zip |
findById -> findByPk
Diffstat (limited to 'server/models/account')
-rw-r--r-- | server/models/account/account.ts | 3 | ||||
-rw-r--r-- | server/models/account/user.ts | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 747b51afb..ee22d8528 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts | |||
@@ -24,7 +24,6 @@ import { getSort, throwIfNotValid } from '../utils' | |||
24 | import { VideoChannelModel } from '../video/video-channel' | 24 | import { VideoChannelModel } from '../video/video-channel' |
25 | import { VideoCommentModel } from '../video/video-comment' | 25 | import { VideoCommentModel } from '../video/video-comment' |
26 | import { UserModel } from './user' | 26 | import { UserModel } from './user' |
27 | import * as Bluebird from '../../helpers/custom-validators/accounts' | ||
28 | import { CONFIG } from '../../initializers' | 27 | import { CONFIG } from '../../initializers' |
29 | 28 | ||
30 | @DefaultScope({ | 29 | @DefaultScope({ |
@@ -136,7 +135,7 @@ export class AccountModel extends Model<AccountModel> { | |||
136 | } | 135 | } |
137 | 136 | ||
138 | static load (id: number, transaction?: Sequelize.Transaction) { | 137 | static load (id: number, transaction?: Sequelize.Transaction) { |
139 | return AccountModel.findById(id, { transaction }) | 138 | return AccountModel.findByPk(id, { transaction }) |
140 | } | 139 | } |
141 | 140 | ||
142 | static loadByUUID (uuid: string) { | 141 | static loadByUUID (uuid: string) { |
diff --git a/server/models/account/user.ts b/server/models/account/user.ts index 017a96657..8aff9f497 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts | |||
@@ -341,7 +341,7 @@ export class UserModel extends Model<UserModel> { | |||
341 | } | 341 | } |
342 | 342 | ||
343 | static loadById (id: number) { | 343 | static loadById (id: number) { |
344 | return UserModel.findById(id) | 344 | return UserModel.findByPk(id) |
345 | } | 345 | } |
346 | 346 | ||
347 | static loadByUsername (username: string) { | 347 | static loadByUsername (username: string) { |