Added this stupid vibecoded app as a test
Build App / Build (push) Waiting to run

This commit is contained in:
2026-08-06 09:58:06 +02:00
parent d9e05fb487
commit a9860f4c94
51 changed files with 10154 additions and 7 deletions
@@ -0,0 +1,29 @@
import { session } from '$lib/stores/session.svelte';
import { apiRequest, type RequestOptions } from './client';
import type { MatchStatsDTO } from './schema-helpers';
/** StatisticsController is `[Authorize]`, like the tournament endpoints. */
function authed(options: RequestOptions): RequestOptions {
return { ...options, token: options.token ?? session.token };
}
/**
* POST /api/Statistics/Matches — set-level statistics (win/loss, games, head to
* head) for the given events, read from the `set` rows an import persisted.
*
* Unlike `GetResults` this takes every event in one call: the service tolerates
* brackets with no set rows instead of throwing, and reports what it could see in
* `coverage`. Always show that coverage — many older brackets were imported
* without sets, so a low `bracketsWithSets` means these numbers describe only a
* slice of the scope.
*/
export function getMatchStats(
eventIds: number[],
options: RequestOptions = {}
): Promise<MatchStatsDTO> {
return apiRequest<MatchStatsDTO>('/api/Statistics/Matches', {
...authed(options),
method: 'POST',
body: eventIds
});
}