Skip to content
Advertisement

findOne() in TypeORM not working properly and giving error

I want to get the prospectousId from Dto, but I am getting the below error:,

Error

tenant.controller.ts

JavaScript

tenant.service.ts

JavaScript

tenant.entity.ts

JavaScript

dto:

JavaScript

What to do to achieve this? Thanks in advance!

Advertisement

Answer

Try using the below code. findOne() is to be replaced by findOneBy() as they say in their changelog.

JavaScript

See the Changelog of TypeORM for more:

findOne() signature without parameters was dropped. If you need a single row from the db you can use a following syntax:

JavaScript

findOne(id) signature was dropped. Use following syntax instead:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement