fixes tcx and kml file conversion upload

This commit is contained in:
Christian Beutel
2024-03-29 15:19:31 +01:00
parent bd1dbcddae
commit c4acab6568
11 changed files with 17 additions and 13 deletions

View File

@@ -245,7 +245,7 @@ export async function trails_create(trail: Trail, photos: File[], gpx: File | Bl
}
}
export async function trails_update(oldTrail: Trail, newTrail: Trail, photos: File[], gpx: File | null) {
export async function trails_update(oldTrail: Trail, newTrail: Trail, photos: File[], gpx: File | Blob | null) {
const waypointUpdates = compareObjectArrays<Waypoint>(oldTrail.expand.waypoints ?? [], newTrail.expand.waypoints ?? []);
@@ -360,13 +360,6 @@ export async function fetchGPX(trail: Trail, f: (url: RequestInfo | URL, config?
return gpxData
}
function setFileURLs(trail: Trail) {
for (let i = 0; i < trail.photos.length; i++) {
const photo = trail.photos[i];
trail.photos[i] = getFileURL(trail, photo)
}
}
function compareObjectArrays<T extends { id?: string }>(oldArray: T[], newArray: T[]) {
const newObjects = [];
const updatedObjects = [];