fixes trail multi save bug

This commit is contained in:
Christian Beutel
2025-03-14 17:36:11 +01:00
parent ababbabadc
commit e5a28d2c42
3 changed files with 21 additions and 13 deletions

View File

@@ -184,9 +184,11 @@ export async function trails_create(trail: Trail, photos: File[], gpx: File | Bl
trail.author = pb.authStore.model!.id
let r = await f('/api/v1/trail', {
let r = await f(`/api/v1/trail?` + new URLSearchParams({
expand: "category,waypoints,summit_logs,trail_share_via_trail",
}), {
method: 'PUT',
body: JSON.stringify({ ...trail, expand: undefined }),
body: JSON.stringify({ ...trail }),
})
if (!r.ok) {
@@ -216,7 +218,7 @@ export async function trails_create(trail: Trail, photos: File[], gpx: File | Bl
throw new APIError(r.status, response.message, response.detail)
}
return await r.json();
return model;
}