diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index 9a7aab9..3f9a125 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -295,17 +295,17 @@ class CCPMethodEditorController extends HTMLElement{ }) } - downloadMethod(method){ + downloadMethod(){ if(this.#locked) return; this.lockRender() - var filename = this.#current.title + "-" + this.#current.version + ".json" - this.#boot.secureFetch(this.#serviceurl + "/methods/" + method + "/shareable").then( + this.#boot.secureFetch(this.#serviceurl + "/methods/" + this.#current.id + "/shareable").then( (resp)=>{ if(resp.status === 200){ return resp.json() }else throw "Error retrieving sharable process: " + resp.status } ).then(data=>{ + const filename = data.title + "-" + data.version + ".json" const objectURL = URL.createObjectURL(data) var tmplnk = document.createElement("a") tmplnk.download = filename @@ -803,7 +803,7 @@ class CCPMethodEditorController extends HTMLElement{ renderDownloadButton(){ return ` - `