From fa62ebe2f0e71d7d5b1f15f5d79c9b0754d66f72 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:04:20 +0700 Subject: [PATCH] fix: relation error if not exist --- src/controllers/ProfileFamilyHistoryController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/ProfileFamilyHistoryController.ts b/src/controllers/ProfileFamilyHistoryController.ts index 45727cb0..29424f1f 100644 --- a/src/controllers/ProfileFamilyHistoryController.ts +++ b/src/controllers/ProfileFamilyHistoryController.ts @@ -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,