basic team profile

This commit is contained in:
yohlo
2025-08-25 22:08:43 -05:00
parent d845254c3d
commit 44417d063b
3 changed files with 29 additions and 2 deletions

View File

@@ -32,6 +32,12 @@ export function transformTeam(record: any): Team {
new Date(a.created!) < new Date(b.created!) ? -1 : 0
)
?.map(transformPlayer) ?? [];
const tournaments =
record.expand?.tournaments
?.sort((a: Tournament, b: Tournament) =>
new Date(a.created!) < new Date(b.created!) ? -1 : 0
)
?.map(transformTournament) ?? [];
return {
id: record.id,
@@ -50,6 +56,7 @@ export function transformTeam(record: any): Team {
created: record.created,
updated: record.updated,
players,
tournaments
};
}