我如何才能将属性从可连接的多对多对象(nestjs,typeorm,postgresql)

时间:2019-11-21 13:46:00

标签: node.js nestjs typeorm

TypeError:无法从可连接的

中读取未定义的get属性的'tablePath'属性
  @ManyToMany(type => VehiculeEntity)
                vehicules: VehiculeEntity[];               

             /*************************************************************/             

  @ManyToMany(type => EmployeEntity)
                    @JoinTable({name : 'T_vehicule_Employe'})
                    employes: EmployeEntity[];

//这是服务和控制器

       async getvehiculeEmploye(){
                    const vehicule = await  this.vehiculeRepository.find({relations: ['employes']});
                    if(!vehicule)
                    return null;
                    const employe = await  this.employerepository.find({relations: ['vehicules']});
                    if(!employe)
                    return null;
                    return  this.vehiculeRepository.find({relations: ['employes']});

              /****************************************************************/


 @Get('vehiculeemploye')
                 async getvehiculeEmploye(){
                     return this.gmaoservice.getvehiculeEmploye();

0 个答案:

没有答案