adds upload dialog and duplicates
This commit is contained in:
@@ -80,7 +80,7 @@ export async function create<T>(event: RequestEvent, schema: ZodSchema, collecti
|
||||
const data = await event.request.json();
|
||||
const safeData = schema.parse(data);
|
||||
|
||||
const r = await pb.collection(Collection[collection]).create<T>(safeData, safeSearchParams)
|
||||
const r = await pb.collection(Collection[collection]).create<T>(safeData, {...safeSearchParams, requestKey: null})
|
||||
|
||||
return r
|
||||
}
|
||||
@@ -124,7 +124,7 @@ export function handleError(e: any) {
|
||||
if (e instanceof ZodError) {
|
||||
return error(400, { message: "invalid_params", detail: e.issues } as any)
|
||||
} else if (e instanceof ClientResponseError && e.status > 0) {
|
||||
return error(e.status as NumericRange<400, 599>, { message: e.message, detail: e.originalError.data } as any)
|
||||
return error(e.status as NumericRange<400, 599>, {...e.response, message: e.message, detail: e.originalError.data } as any)
|
||||
} else if (e instanceof SyntaxError) {
|
||||
return error(400, "invalid_json")
|
||||
} else {
|
||||
|
||||
@@ -11,7 +11,7 @@ import Track from "$lib/models/gpx/track";
|
||||
import TrackSegment from "$lib/models/gpx/track-segment";
|
||||
import GPXWaypoint from "$lib/models/gpx/waypoint";
|
||||
import EasyFit from "$lib/vendor/easy-fit/easy-fit";
|
||||
import type { GeoJSON, Feature, FeatureCollection, GeoJsonProperties, Position } from 'geojson';
|
||||
import type { Feature, FeatureCollection, GeoJSON, GeoJsonProperties, Position } from 'geojson';
|
||||
import * as xmldom from 'xmldom';
|
||||
import { bbox, splitMultiLineStringToLineStrings } from "./geojson_util";
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function gpx2trail(gpxString: string, fallbackName?: string) {
|
||||
trail.expand!.waypoints.push(wp);
|
||||
}
|
||||
|
||||
const totals = gpx.getTotals()
|
||||
const totals = gpx.features
|
||||
|
||||
const trackPoints = gpx.trk?.at(0)?.trkseg?.at(0)?.trkpt
|
||||
const routePoints = gpx.rte?.at(0)?.rtept;
|
||||
|
||||
Reference in New Issue
Block a user