Show siblings on member page

This commit is contained in:
2023-08-16 08:33:07 +02:00
parent e4ca9f7e9e
commit d0cfc0e981
2 changed files with 32 additions and 0 deletions

View File

@ -195,6 +195,16 @@ export class MembersList {
children(id: number): Member[] {
return this.list.filter((m) => m.mother === id || m.father === id);
}
siblings(id: number): Member[] {
const p = this.get(id);
return this.list.filter(
(m) =>
m.id !== p?.id &&
((m.mother && m.mother === p?.mother) ||
(m.father && m.father === p?.father))
);
}
}
export class MemberApi {