ソースを参照

[add]

性別の初期表示を追加
poohr 3週間前
コミット
31189db006
1個のファイルの変更17行の追加3行の削除
  1. 17
    3
      src/app/pages/family-edit/family-edit.ts

+ 17
- 3
src/app/pages/family-edit/family-edit.ts ファイルの表示

@@ -47,6 +47,10 @@ export class FamilyEdit {
47 47
           relationship: this.family.relationship,
48 48
           birthDate: this.family.birthDate,
49 49
           note: this.family.note,
50
+          fatherId: this.family.fatherId,
51
+          motherId: this.family.motherId,
52
+          spouseId: this.family.spouseId,
53
+          gender: this.family.gender,
50 54
         });
51 55
       }
52 56
     }
@@ -58,9 +62,19 @@ export class FamilyEdit {
58 62
     }
59 63
 
60 64
     if (!this.familyId && this.relationMode === 'child') {
61
-      this.familyForm.patchValue({
62
-        fatherId: this.baseFamilyId,
63
-      });
65
+      const baseFamily = this.familyService.getFamilyById(this.baseFamilyId);
66
+
67
+      if (baseFamily?.gender === 'male') {
68
+        this.familyForm.patchValue({
69
+          fatherId: this.baseFamilyId,
70
+        });
71
+      }
72
+
73
+      if (baseFamily?.gender === 'female') {
74
+        this.familyForm.patchValue({
75
+          motherId: this.baseFamilyId,
76
+        });
77
+      }
64 78
     }
65 79
   }
66 80
 

読み込み中…
キャンセル
保存