X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Fuser.ts;h=c1f22b76aaad87c4195416c0096d6e1ffacd80fe;hb=3fbc6974334ca58c068f0f9def0b0a40db2a6de1;hp=11003645c8d7d52456f7ac1c7c23cbbfc393c65f;hpb=47d8e266f16b91fec7e4a15a8372d50c2909c042;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/user.ts b/server/models/account/user.ts index 11003645c..c1f22b76a 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts @@ -28,7 +28,7 @@ import { MUserFormattable, MUserNotifSettingChannelDefault, MUserWithNotificationSetting, - MVideoFullLight + MVideoWithRights } from '@server/types/models' import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users' import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models' @@ -564,17 +564,17 @@ export class UserModel extends Model { static loadByUsername (username: string): Promise { const query = { where: { - username: { [Op.iLike]: username } + username } } return UserModel.findOne(query) } - static loadForMeAPI (username: string): Promise { + static loadForMeAPI (id: number): Promise { const query = { where: { - username: { [Op.iLike]: username } + id } } @@ -819,7 +819,7 @@ export class UserModel extends Model { .then(u => u.map(u => u.username)) } - canGetVideo (video: MVideoFullLight) { + canGetVideo (video: MVideoWithRights) { const videoUserId = video.VideoChannel.Account.userId if (video.isBlacklisted()) {