Lib: Update fetcher + schema after database update
This commit is contained in:
@ -13,6 +13,7 @@ import type {
|
|||||||
RaceResult,
|
RaceResult,
|
||||||
ScrapedDriverStanding,
|
ScrapedDriverStanding,
|
||||||
ScrapedRaceResult,
|
ScrapedRaceResult,
|
||||||
|
ScrapedRaceResultAcc,
|
||||||
ScrapedStartingGrid,
|
ScrapedStartingGrid,
|
||||||
ScrapedTeamStanding,
|
ScrapedTeamStanding,
|
||||||
SeasonPick,
|
SeasonPick,
|
||||||
@ -359,3 +360,16 @@ export const fetch_scraped_raceresults = async (
|
|||||||
|
|
||||||
return scraped_raceresults;
|
return scraped_raceresults;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch all [ScrapedRaceResultsAcc] from the database, ordered ascendingly by race step.
|
||||||
|
*/
|
||||||
|
export const fetch_scraped_raceresultsacc = async (
|
||||||
|
fetch: (_: any) => Promise<Response>,
|
||||||
|
): Promise<ScrapedRaceResultAcc[]> => {
|
||||||
|
const scraped_raceresultsacc: ScrapedRaceResultAcc[] = await pb
|
||||||
|
.collection("scraped_raceresultsacc")
|
||||||
|
.getFullList({ fetch: fetch, sort: "+race_step" });
|
||||||
|
|
||||||
|
return scraped_raceresultsacc;
|
||||||
|
};
|
||||||
|
@ -176,6 +176,13 @@ export interface ScrapedRaceResult {
|
|||||||
points: number;
|
points: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ScrapedRaceResultAcc {
|
||||||
|
id: string;
|
||||||
|
race_step: number; // This maps to races
|
||||||
|
driver_code: string; // This maps to drivers
|
||||||
|
acc_points: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ScrapedDriverStanding {
|
export interface ScrapedDriverStanding {
|
||||||
id: string;
|
id: string;
|
||||||
driver_code: string; // This maps to drivers
|
driver_code: string; // This maps to drivers
|
||||||
|
Reference in New Issue
Block a user