fix: relation error if not exist

This commit is contained in:
Methapon2001 2024-03-22 16:04:20 +07:00
parent cc430a1a38
commit fa62ebe2f0

View file

@ -336,7 +336,7 @@ export class ProfileFamilyHistoryController extends Controller {
}
}),
...childrenRecord.map(async (v) => {
if (!children.find((x) => x.id === v.id)) {
if (children.find((x) => x.id === v.id)) {
return await this.childrenHistoryRepo.save(
this.childrenHistoryRepo.create({
...v,