|
|
@@ -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
|
|