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 @@ -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 ( / f i l e n a m e = \" ( .+ ?) \" / ) ?. [ 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 ) {
You can’t perform that action at this time.
0 commit comments