File tree Expand file tree Collapse file tree 1 file changed +7
-24
lines changed
Expand file tree Collapse file tree 1 file changed +7
-24
lines changed Original file line number Diff line number Diff 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 ( / f i l e n a m e = \" ( .+ ?) \" / ) ?. [ 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 ) {
You can’t perform that action at this time.
0 commit comments