regionals

This commit is contained in:
yohlo
2026-03-01 16:21:27 -06:00
parent f83a7d69c8
commit 6199afc687
14 changed files with 849 additions and 137 deletions

View File

@@ -141,5 +141,17 @@ export function createMatchesService(pb: PocketBase) {
return results.map(match => transformMatch(match));
},
async getMatchesByGroup(groupId: string): Promise<Match[]> {
logger.info("PocketBase | Getting matches for group", { groupId });
const results = await pb.collection("matches").getFullList({
filter: `group = "${groupId}"`,
expand: "tournament, home, away, home.players, away.players",
sort: "created",
});
return results.map(match => transformMatch(match));
},
};
}