diff --git a/geneit_app/src/api/MemberApi.ts b/geneit_app/src/api/MemberApi.ts index 74502e1..56d1d49 100644 --- a/geneit_app/src/api/MemberApi.ts +++ b/geneit_app/src/api/MemberApi.ts @@ -1,4 +1,5 @@ import { APIClient } from "./ApiClient"; +import { Couple } from "./CoupleApi"; export type Sex = "M" | "F"; @@ -213,6 +214,13 @@ export class MembersList { return this.list.filter((m) => m.mother === id || m.father === id); } + childrenOfCouple(c: Couple): Member[] { + if (!c.husband && !c.wife) return []; + return this.list.filter( + (m) => m.mother === c.wife && m.father === c.husband + ); + } + siblings(id: number): Member[] { const p = this.get(id); return this.list.filter( diff --git a/geneit_app/src/routes/family/FamilyCoupleRoute.tsx b/geneit_app/src/routes/family/FamilyCoupleRoute.tsx index 8b3194a..a9a9bcb 100644 --- a/geneit_app/src/routes/family/FamilyCoupleRoute.tsx +++ b/geneit_app/src/routes/family/FamilyCoupleRoute.tsx @@ -124,7 +124,7 @@ export function FamilyCoupleRoute(): React.ReactElement { build={() => ( m.sex === "F" || m.sex === undefined} current={couple.wife} /> +
{/* State */}