Skip to content

Commit 934071d

Browse files
authored
♻️ [Frontend] Retire PUT /study (#6211)
1 parent dc9dc44 commit 934071d

File tree

3 files changed

+2
-61
lines changed

3 files changed

+2
-61
lines changed

services/static-webserver/client/source/class/osparc/data/Resources.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,6 @@ qx.Class.define("osparc.data.Resources", {
191191
method: "PATCH",
192192
url: statics.API + "/projects/{studyId}"
193193
},
194-
put: {
195-
method: "PUT",
196-
url: statics.API + "/projects/{studyId}"
197-
},
198194
delete: {
199195
method: "DELETE",
200196
url: statics.API + "/projects/{studyId}"

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

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -638,53 +638,6 @@ qx.Class.define("osparc.data.model.Study", {
638638
const studyData = this.serialize();
639639
return studyData;
640640
});
641-
},
642-
643-
updateStudy: function(params) {
644-
return new Promise((resolve, reject) => {
645-
osparc.data.Resources.fetch("studies", "put", {
646-
url: {
647-
"studyId": this.getUuid()
648-
},
649-
data: {
650-
...this.serialize(),
651-
...params
652-
}
653-
})
654-
.then(data => {
655-
this.__updateModel(data);
656-
qx.event.message.Bus.getInstance().dispatchByName("updateStudy", data);
657-
resolve(data);
658-
})
659-
.catch(err => reject(err));
660-
});
661-
},
662-
663-
__updateModel: function(data) {
664-
if ("dev" in data) {
665-
delete data["dev"];
666-
}
667-
Object.keys(data).forEach(key => {
668-
if (this.self().IgnoreModelizationProps.includes(key)) {
669-
delete data[key];
670-
}
671-
});
672-
673-
this.set({
674-
...data,
675-
creationDate: new Date(data.creationDate),
676-
lastChangeDate: new Date(data.lastChangeDate),
677-
workbench: this.getWorkbench(),
678-
ui: this.getUi()
679-
});
680-
681-
const nodes = this.getWorkbench().getNodes();
682-
Object.values(nodes).forEach(node => {
683-
const nodeId = node.getNodeId();
684-
if (nodeId in data.workbench) {
685-
node.populateStates(data.workbench[nodeId]);
686-
}
687-
});
688641
}
689642
}
690643
});

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -759,16 +759,8 @@ qx.Class.define("osparc.desktop.StudyEditor", {
759759
}
760760

761761
this.__updatingStudy++;
762-
let updatePromise = null;
763-
if (osparc.utils.Utils.isDevelopmentPlatform()) {
764-
// For now, master deployment only
765-
const studyDiffs = this.__getStudyDiffs();
766-
updatePromise = this.getStudy().patchStudyDelayed(studyDiffs)
767-
} else {
768-
const newObj = this.getStudy().serialize();
769-
updatePromise = this.getStudy().updateStudy(newObj);
770-
}
771-
return updatePromise
762+
const studyDiffs = this.__getStudyDiffs();
763+
return this.getStudy().patchStudyDelayed(studyDiffs)
772764
.then(studyData => this.__setStudyDataInBackend(studyData))
773765
.catch(error => {
774766
if ("status" in error && error.status === 409) {

0 commit comments

Comments
 (0)