Skip to content

Commit ef2c6b7

Browse files
committed
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWeb-Front into fix/harmonize_microservices
2 parents 33be325 + 37cae25 commit ef2c6b7

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

composables/project_manager.js

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,13 @@ export function useProjectManager() {
1313
const defaultName = "project.vease"
1414

1515
await infraStore.create_connection()
16-
let downloaded = false
17-
const result = await api_fetch(
18-
{ schema, params: { snapshot, filename: defaultName } },
19-
{
20-
response_function: function (response) {
21-
if (downloaded) return
22-
downloaded = true
23-
const data = response._data
24-
const headerName =
25-
(response.headers &&
26-
typeof response.headers.get === "function" &&
27-
(response.headers
28-
.get("Content-Disposition")
29-
?.match(/filename=\"(.+?)\"/)?.[1] ||
30-
response.headers.get("new-file-name"))) ||
31-
defaultName
32-
if (!headerName.toLowerCase().endsWith(".vease")) {
33-
throw new Error("Server returned non-.vease project archive")
34-
}
35-
fileDownload(data, headerName)
36-
},
37-
},
38-
)
39-
return result
16+
const result = await $fetch(schema.$id, {
17+
baseURL: geode.base_url,
18+
method: schema.methods.filter((m) => m !== "OPTIONS")[0],
19+
body: { snapshot, filename: defaultName },
20+
})
21+
fileDownload(result, defaultName)
22+
return { result }
4023
}
4124

4225
const importProjectFile = async function (file) {

0 commit comments

Comments
 (0)