typeorm data array from relation

The solution for “typeorm data array from relation” can be found here. The following code will assist you in solving the problem.

const getAllTeleMarketing: Record[] = await this.telemarketingModel
.createQueryBuilder(‘telemarketings’)
.leftJoinAndSelect(‘telemarketings.users’, ‘users’)
.leftJoinAndSelect(‘users.userToUserRoles’, ‘user_roles’)
.leftJoinAndSelect(‘user_roles.role_id’, ‘roles’)
.leftJoinAndSelect(‘telemarketings.projects’, ‘projects’)
.where(‘projects.latest_status = :latest_status’, { latest_status: ‘NEW’ })
.getMany()

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in