Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes did you make?
Refactored the query builder in
getUsers
function, to usefind
and conditional parametersWhy did you make the changes?
Following typeorm 0.2.0 -> 0.3.0 update in #405 , calling
getUsers
resulted in the error:ERROR [error] Failed GET "/api/v1/user?searchCriteria=%7B%22email%22%3A%22tech%2B1111%40chayn.co%22%2C%22partnerAccess%22%3A%7B%22featureTherapy%22%3Atrue%2C%22active%22%3Atrue%7D%2C%22include%22%3A%5B%22partnerAccess%22%5D%2C%22fields%22%3A%5B%22partnerAccess%22%5D%2C%22limit%22%3A%2210%22%7D" for ::ffff:192.168.65.1 - status: undefined, message: missing FROM-clause entry for table "partneraccess"
There seems to be an issue using left joins on
user.partnerAccess
in this case, but there were no errors using.find