Skip to content

Commit e38ef8b

Browse files
committed
call backend
1 parent ff122d3 commit e38ef8b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

services/static-webserver/client/source/class/osparc/study/CreateFunction.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ qx.Class.define("osparc.study.CreateFunction", {
5656
});
5757
form.add(description, this.tr("Description"), null, "description");
5858

59-
const createFunctionBtn = this.__createFunctionBtn = new qx.ui.form.FetchButton().set({
59+
const createFunctionBtn = this.__createFunctionBtn = new osparc.ui.form.FetchButton().set({
6060
appearance: "strong-button",
6161
label: this.tr("Create"),
6262
allowGrowX: false,
@@ -131,9 +131,14 @@ qx.Class.define("osparc.study.CreateFunction", {
131131
"input1": 5
132132
},
133133
};
134-
console.log("Creating function with data: ", functionData);
135134

136-
this.__createFunctionBtn.setFetching(false);
135+
const params = {
136+
data: functionData,
137+
};
138+
osparc.data.Resources.fetch("functions", "create", params)
139+
.then(() => osparc.FlashMessenger.logAs(this.tr("Function created"), "INFO"))
140+
.catch(err => osparc.FlashMessenger.logError(err))
141+
.finally(() => this.__createFunctionBtn.setFetching(false));
137142
},
138143

139144
getCreateFunctionButton: function() {

0 commit comments

Comments
 (0)