Lib: Add seasonpickresult table schema + fetcher
This commit is contained in:
@ -18,6 +18,7 @@ import type {
|
|||||||
ScrapedTeamStanding,
|
ScrapedTeamStanding,
|
||||||
SeasonPick,
|
SeasonPick,
|
||||||
SeasonPickedUser,
|
SeasonPickedUser,
|
||||||
|
SeasonPickResult,
|
||||||
Substitution,
|
Substitution,
|
||||||
Team,
|
Team,
|
||||||
User,
|
User,
|
||||||
@ -115,6 +116,19 @@ export const fetch_raceresults = async (
|
|||||||
return raceresults;
|
return raceresults;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch all [SeasonPickResults] from the database. Should either contain 0 or 1 element.
|
||||||
|
*/
|
||||||
|
export const fetch_seasonpickresults = async (
|
||||||
|
fetch: (_: any) => Promise<Response>,
|
||||||
|
): Promise<SeasonPickResult[]> => {
|
||||||
|
const seasonpickresults: SeasonPickResult[] = await pb
|
||||||
|
.collection("seasonpickresults")
|
||||||
|
.getFullList({ fetch: fetch });
|
||||||
|
|
||||||
|
return seasonpickresults;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch all [Users] (sorted ascending by username) with file URLs for avatars
|
* Fetch all [Users] (sorted ascending by username) with file URLs for avatars
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -109,6 +109,18 @@ export interface RaceResult {
|
|||||||
dnfs: string[];
|
dnfs: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SeasonPickResult {
|
||||||
|
id: string;
|
||||||
|
correcthottake: string[];
|
||||||
|
wdcwinner: string;
|
||||||
|
wccwinner: string;
|
||||||
|
mostovertakes: string[];
|
||||||
|
mostdnfs: string[];
|
||||||
|
doohanstarts: number;
|
||||||
|
teamwinners: string[];
|
||||||
|
podiums: string[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface CurrentPickedUser {
|
export interface CurrentPickedUser {
|
||||||
id: string;
|
id: string;
|
||||||
username: string;
|
username: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user