Is it possible to use optional parameters in createQueryBuilder?
for example, I have this code:
let users = await this.conn
.getRepository(UserEntity)
.createQueryBuilder("user")
.where("user.firstName LIKE :search", { search: dto.search })
.getMany();
my optional parameter is search, I want to launch clauses .where only when dto.search is not null, but when he is null then should skip this function(where) and goes to getMany.
Have anybody any idea how to do this?