crud: eager relation load breaks foreign key update
When relation set to eager loading, update a foreign key will be failed.
partial entity
export class Book {
catId:number;
cat:Cat;
}
When update catId it will load cat to override the update.
cat in found and only catId in dto
The result will be
{
"catId": "new value",
"cat": {"id":"old value"}
}
typeorm will use object instead of id
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 7
- Comments: 15 (2 by maintainers)
@alexmantaut thanks for the attention. you can see after the refactor this issue seems gone. you can try the
nextversion or just waiting for the next release.btw, @zMotivat0r When is it released?