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
.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’ })

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

More questions on [categories-list]

inline scripts encapsulated in