fixes tcx and kml file conversion upload
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user