Skip to content

Commit 1f26729

Browse files
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWeb-Front into fix/nuxt_app_folder
2 parents e58a27d + 37cae25 commit 1f26729

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

app/composables/project_manager.js

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

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

4427
const importProjectFile = async function (file) {

0 commit comments

Comments
 (0)