fix lost gpx on summit log update (#702)

* fix lost gpx on summit log update

* fix missing trail in summit log modal
This commit is contained in:
slothful-vassal
2026-01-11 22:13:39 +01:00
committed by GitHub
parent 9282f37c15
commit 6e5edf7ed7
3 changed files with 45 additions and 11 deletions

View File

@@ -79,7 +79,7 @@ export async function summit_logs_update(oldSummitLog: SummitLog, newSummitLog:
newSummitLog.author = user.actor
const formData = objectToFormData(newSummitLog, ["expand"])
const formData = objectToFormData(newSummitLog, ["expand", "gpx", "_gpx"])
for (const photo of newSummitLog._photos ?? []) {
formData.append("photos", photo)
@@ -93,6 +93,8 @@ export async function summit_logs_update(oldSummitLog: SummitLog, newSummitLog:
if (newSummitLog._gpx) {
formData.append("gpx", newSummitLog._gpx);
} else if (newSummitLog.gpx === "") {
formData.append("gpx", "");
}
let r = await fetch('/api/v1/summit-log/form/' + newSummitLog.id + '?' + new URLSearchParams({
@@ -151,4 +153,4 @@ export function buildFilterText(filter: SummitLogFilter,): string {
return filterText;
}
}