nestjsx / crud

NestJs CRUD for RESTful APIs
https://github.com/nestjsx/crud/wiki
MIT License
4.04k stars 533 forks source link

Query error in join and filter request #724

Closed Gustavoo44 closed 3 years ago

Gustavoo44 commented 3 years ago

This request was working fine until some update package that i can't identify. Now all my requests using "relation.field" doesnt work anymore.

/pests?filter=products.id||$eq||92

I tried to add join but did not work too. /pests?join=products&filter=products.id||$eq||92

The error:

query failed: SELECT "Pest"."in_id" AS "Pest_in_id", "Pest"."dt_create_date" AS "Pest_dt_create_date", "Pest"."dt_update_date" AS "Pest_dt_update_date", "Pest"."bn_status" AS "Pest_bn_status", "Pest"."deletedAt" AS "Pest_deletedAt", "Pest"."st_name" AS "Pest_st_name", "Pest"."st_color" AS "Pest_st_color", "Pest"."st_image_path" AS "Pest_st_image_path", "Pest"."bl_sent" AS "Pest_bl_sent", "Pest"."in_created_by" AS "Pest_in_created_by", "Pest"."in_updated_by" AS "Pest_in_updated_by", "products"."in_id" AS "products_in_id", "products"."dt_create_date" AS "products_dt_create_date", "products"."dt_update_date" AS "products_dt_update_date", "products"."bn_status" AS "products_bn_status", "products"."deletedAt" AS "products_deletedAt", "products"."st_name" AS "products_st_name", "products"."st_description" AS "products_st_description", "products"."en_type" AS "products_en_type", "products"."st_image_path" AS "products_st_image_path", "products"."db_portion_quantity" AS "products_db_portion_quantity", "products"."en_measure_unit" AS "products_en_measure_unit", "products"."in_created_by" AS "products_in_created_by", "products"."in_updated_by" AS "products_in_updated_by" FROM "r_pest" "Pest" LEFT JOIN "r_product_pest" "products_Pest" ON "products_Pest"."rPestInId"="Pest"."in_id" LEFT JOIN "r_product" "products" ON "products"."in_id"="products_Pest"."rProductInId" AND ("products"."deletedAt" IS NULL) WHERE ( "products"."in_id" = :andWherepest.products.id1121458839266400 ) AND ( "Pest"."deletedAt" IS NULL ) error: error: syntax error at or near ":"

Thanks!

NicomUA commented 3 years ago

I have same issue with latest typeorm@0.2.36 . try downgrade to typeorm@0.2.34

Gustavoo44 commented 3 years ago

Thank very much man!!! You saved my projects!! It's working fine now!!