Replies: 1 comment
-
If you want help, you'll have to provide a complete reproduction, from this it's impossible to tell what is happening. It will be most probably an issue with inference of the constructor parameter names, which can be caused by many things, including how you set up TS support. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Take this code for example
user = this.usersRepository.create({
email: data.email,
timezone: data.timezone,
status: UserStatus.INACTIVE,
last_login_ip: data.last_login_ip,
last_login_at: data.last_login_at,
});
This is what's being passed in
{
email: 'sheh6260@gmail.com',
timezone: 'Australia/Sydney',
status: 'inactive',
last_login_ip: undefined,
last_login_at: 2024-04-03T02:17:35.007Z
}
When this is recieved in the entity constructor
The console log is
{
email: 'sheh6260@gmail.com', <----------------------- ENTIRE DATA object is passed into name parameter?
timezone: 'Australia/Sydney',
status: 'inactive',
last_login_ip: undefined,
last_login_at: 2024-04-03T02:17:35.007Z
} null {
email: 'sheh6260@gmail.com', <----------------------- ENTIRE DATA object is passed into email parameter?
timezone: 'Australia/Sydney',
status: 'inactive',
last_login_ip: undefined,
last_login_at: 2024-04-03T02:17:35.007Z
} sheh6260@gmail.com Australia/Sydney inactive
Its passing the entire create data object into individual entity parameters. This was all working fine before, why is this happening our entire system is breaking.
Versions
"@mikro-orm/cli": "^6.1.4",
"@mikro-orm/core": "^6.1.4",
"@mikro-orm/migrations": "^6.1.4",
"@mikro-orm/mysql": "^6.1.4",
"@mikro-orm/nestjs": "^5.2.3",
"@mikro-orm/reflection": "^6.1.4",
"@mikro-orm/seeder": "^6.1.4",
Beta Was this translation helpful? Give feedback.
All reactions