Lib: Update fetchers and schema after database changes
This commit is contained in:
@ -9,6 +9,7 @@ import type {
|
||||
RacePick,
|
||||
RacePickPoints,
|
||||
RacePickPointsAcc,
|
||||
RacePickPointsTotal,
|
||||
RaceResult,
|
||||
ScrapedDriverStanding,
|
||||
ScrapedRaceResult,
|
||||
@ -281,7 +282,7 @@ export const fetch_racepickpoints = async (
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetch all [RacePickPointsAcc] from the database, ordered descendingly by total points.
|
||||
* Fetch all [RacePickPointsAcc] from the database, ordered ascendingly by step.
|
||||
*/
|
||||
export const fetch_racepickpointsacc = async (
|
||||
fetch: (_: any) => Promise<Response>,
|
||||
@ -293,6 +294,19 @@ export const fetch_racepickpointsacc = async (
|
||||
return racepickpointsacc;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetch all [RacePickPointsTotal] from the database, ordered descendingly by total points.
|
||||
*/
|
||||
export const fetch_racepickpointstotal = async (
|
||||
fetch: (_: any) => Promise<Response>,
|
||||
): Promise<RacePickPointsTotal[]> => {
|
||||
const racepickpointstotal: RacePickPointsTotal[] = await pb
|
||||
.collection("racepickpointstotal")
|
||||
.getFullList({ fetch: fetch });
|
||||
|
||||
return racepickpointstotal;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetch all [ScrapedDriverStandings] from the database, ordered ascendingly by position.
|
||||
*/
|
||||
|
@ -140,11 +140,21 @@ export interface RacePickPoints {
|
||||
}
|
||||
|
||||
export interface RacePickPointsAcc {
|
||||
id: string;
|
||||
user: string;
|
||||
step: number;
|
||||
acc_pxx_points: number;
|
||||
acc_dnf_points: number;
|
||||
acc_points: number;
|
||||
}
|
||||
|
||||
export interface RacePickPointsTotal {
|
||||
id: string;
|
||||
user: string;
|
||||
total_pxx_points: number;
|
||||
total_dnf_points: number;
|
||||
total_points: number;
|
||||
total_points_per_pick: number;
|
||||
}
|
||||
|
||||
// Scraped Data
|
||||
|
Reference in New Issue
Block a user