const pushes = await pushRepo
.createQueryBuilder('push')
.select('push.push_id')
.addSelect('other_profile.user_profile_img')
.leftJoin('push.other_user', 'other_user')
.leftJoin('other_user.profile', 'other_profile')
.where('push.receiver = :receiver', { receiver: userId })
.orderBy('push.created_at', 'DESC')
.getMany();
const pushes = await pushRepo
.createQueryBuilder('push')
.select('push.push_id')
.addSelect('other_user.id') <===
.addSelect('other_profile.user_profile_img')
.leftJoin('push.other_user', 'other_user')
.leftJoin('other_user.profile', 'other_profile')
.where('push.receiver = :receiver', { receiver: userId })
.orderBy('push.created_at', 'DESC')
.getMany();
leftJoin시 해당 엔티티의 아이디를 select하지 않으면 해당 엔티티의 다른 값을 가져올 수 없다.
정말 꿀팁이네요