П
Size: a a a
П
П
П
AS
SL

М
М
A
A
A
A
A
А
public findOne = async (userIs: number, options: IFindOptions): Promise<UserRo | UserEntity | null> => {
const user = await this._userRepository.findOne(userIs);
if (!user) return null;
if (options.returnEntity) return user;
return user.toResponseObject()
};const user = await this._userService.findOne(payload.userId, { returnEntity: true });
console.log(user.authSalt)ю следующую ошибку public async findOne<T extends boolean>(
userId: number, returnEntity?: T
): Promise<T extends true ? UserEntity : UserRo | null> {
const user = await this._userRepository.findOne(userId);
if (!user) return null;
return returnEntity ? user : user.toResponseObject() as any;
}
A
AS
М
М
М
A
A