Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.findOne reduces relations to an empty array (regression) #7882

Closed
2 of 21 tasks
satanTime opened this issue Jul 10, 2021 · 0 comments · Fixed by #7887
Closed
2 of 21 tasks

.findOne reduces relations to an empty array (regression) #7882

satanTime opened this issue Jul 10, 2021 · 0 comments · Fixed by #7887

Comments

@satanTime
Copy link
Contributor

Issue Description

const relations = [
  "company",
];

const user1 = await connection.getRepository(User).findOne(userAdmin.id, {
  relations,
});

console.log(relations); // prints []

Expected Behavior

relations stays untouched

Actual Behavior

relations is reduced to an empty array

Steps to Reproduce

Check the description above

My Environment

mysql on master branch

Relevant Database Driver(s)

  • aurora-data-api
  • aurora-data-api-pg
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don't know how to start. I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant