mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-24 16:03:02 +00:00
fix(ski-routing): no promise in a condition and no await in a loop, ski route type from its schema
ski-areas.service checks the pending load and download against null and undefined, the area refresh lane recurses instead of awaiting in a loop, TourSkiRoute is inferred from its schema, the ways answer is read by complete === false, and /v1/routes no longer needs a truncated field.
This commit is contained in:
@@ -23,7 +23,6 @@ import {
|
||||
type PaddleLock,
|
||||
type PaddleRegionBoundary,
|
||||
type PaddleRegionGraphStats,
|
||||
type SkiRouteOptions,
|
||||
type TourChange,
|
||||
type TourFixedLeg,
|
||||
type TourSourceHintChange,
|
||||
@@ -194,20 +193,19 @@ export const TOUR_HIKING_PREFERENCES: JsonColumn<HikingPreferences | null> = {
|
||||
fallback: () => null,
|
||||
};
|
||||
|
||||
/** What a ski tour's legs were planned with: the piste router's options and the piste data build they ran on. */
|
||||
export interface TourSkiRoute {
|
||||
options: SkiRouteOptions;
|
||||
build: string | null;
|
||||
/** The legs the piste router planned, by the index of the point each starts at; absent where the save did not say. */
|
||||
planned_legs?: number[];
|
||||
}
|
||||
|
||||
/**
|
||||
* What a ski tour's legs were planned with: the piste router's options and the
|
||||
* piste data build they ran on. planned_legs names the legs the piste router
|
||||
* planned, by the index of the point each starts at; absent where the save did not say.
|
||||
*/
|
||||
const tourSkiRouteSchema = z.object({
|
||||
options: skiRouteOptionsSchema,
|
||||
build: z.string().nullable(),
|
||||
planned_legs: skiPlannedLegsSchema.optional(),
|
||||
});
|
||||
|
||||
export type TourSkiRoute = z.infer<typeof tourSkiRouteSchema>;
|
||||
|
||||
/** A ski tour's piste router options. A broken row reads as none, and the planner offers the defaults. */
|
||||
export const TOUR_SKI_ROUTE: JsonColumn<TourSkiRoute | null> = {
|
||||
column: 'tours.ski_options',
|
||||
|
||||
Reference in New Issue
Block a user