From 9b39106d5757caf221a88e42e05167a6fac479c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Feb 2019 14:28:06 +0100 Subject: findById -> findByPk --- server/models/account/account.ts | 3 +-- server/models/account/user.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'server/models/account') 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' import { VideoChannelModel } from '../video/video-channel' import { VideoCommentModel } from '../video/video-comment' import { UserModel } from './user' -import * as Bluebird from '../../helpers/custom-validators/accounts' import { CONFIG } from '../../initializers' @DefaultScope({ @@ -136,7 +135,7 @@ export class AccountModel extends Model { } static load (id: number, transaction?: Sequelize.Transaction) { - return AccountModel.findById(id, { transaction }) + return AccountModel.findByPk(id, { transaction }) } 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 { } static loadById (id: number) { - return UserModel.findById(id) + return UserModel.findByPk(id) } static loadByUsername (username: string) { -- cgit v1.2.3