Closed mbagsik00 closed 1 week ago
This is related to useDefineForClassFields
setting of TypeScript.
Default:
true
if target is ES2022 or higher, including ESNext,false
otherwise.
I'm marking it as "accepting PRs".
same problem on my project with nodejs: 18.10.0
I've published a PR to address this issue, can someone take a look? Thank you!
Hi @Ginden , I think the @andrewnester fix was merged successfully. Could you please mark this Issue as closed? Thank's!
I still have this issue using typeorm@0.3.20
. is the fix has been published?
@MiqueiasGFernandes @erfanium As you can see, this PR was rejected.
I'm closing it as "won't fix", unfortunately.
Issue Description
repository.create()
includes the undefined field which breaks the DB update query when using ES2022 as a target intsconfig
Expected Behavior
Previously we're using es6 as a target for
tsconfig
and the field that we didn't pass in therepository.create()
will not be included in the response.Actual Behavior
When using ES2022 as a target in
tsconfig
it returns all the fields that are declared in the entity and sets the value toundefined
for the fields that don't exist in the object when creating the repository. This causes some issues when doing an update since it sets other fields tonull
if we don't include the field in the repository creation. I know we can easily fix this by adding all the fields when creating the repository but didn't expect this to break.Steps to Reproduce
undefined
value.My Environment
Additional Context
Relevant Database Driver(s)
aurora-mysql
aurora-postgres
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
spanner
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?