adds filename fallback for trail upload

This commit is contained in:
Christian Beutel
2024-10-06 11:35:40 +02:00
parent efb411e5ff
commit d94758a886
6 changed files with 28 additions and 19 deletions

View File

@@ -346,12 +346,14 @@ export async function trails_get_bounding_box(f: (url: RequestInfo | URL, config
}
export async function trails_upload(file: File, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch): Promise<TrailFilterValues> {
const fd = new FormData()
fd.append("name", file.name),
fd.append("file", file)
const r = await f('/api/v1/trail/upload', {
headers: {
"Content-Type": "multipart/form-data"
},
method: 'PUT',
body: file
body: fd
})
if (r.ok) {