Skip to content

Commit f883996

Browse files
committed
closeStudy
1 parent 680e748 commit f883996

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -928,13 +928,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
928928
},
929929

930930
__closeStudy: function() {
931-
const params = {
932-
url: {
933-
"studyId": this.getStudy().getUuid()
934-
},
935-
data: osparc.utils.Utils.getClientSessionID()
936-
};
937-
osparc.data.Resources.fetch("studies", "close", params)
931+
osparc.store.Store.getInstance().closeStudy(this.getStudy().getUuid())
938932
.catch(err => console.error(err));
939933
},
940934

services/static-webserver/client/source/class/osparc/store/Study.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ qx.Class.define("osparc.store.Study", {
7777
return osparc.data.Resources.fetch("studies", "openDisableAutoStart", params);
7878
},
7979

80+
closeStudy: function(studyId) {
81+
const params = {
82+
url: {
83+
studyId,
84+
},
85+
data: osparc.utils.Utils.getClientSessionID()
86+
};
87+
return osparc.data.Resources.fetch("studies", "close", params);
88+
},
89+
8090
createStudy: function(studyData) {
8191
const params = {
8292
data: studyData

services/static-webserver/client/source/class/osparc/viewer/NodeViewer.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,7 @@ qx.Class.define("osparc.viewer.NodeViewer", {
2525

2626
this._setLayout(new qx.ui.layout.VBox());
2727

28-
const params = {
29-
url: {
30-
studyId
31-
},
32-
data: osparc.utils.Utils.getClientSessionID()
33-
};
34-
osparc.data.Resources.fetch("studies", "open", params)
28+
osparc.store.Study.getInstance().openStudy(studyId)
3529
.then(studyData => {
3630
// create study
3731
const study = new osparc.data.model.Study(studyData);

0 commit comments

Comments
 (0)