From 1b07e66d024a97e72d99b9c16a97af8beb9b5bbd Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 19 Aug 2024 15:37:04 +0200 Subject: [PATCH] retire PUT /study --- .../source/class/osparc/data/Resources.js | 4 -- .../source/class/osparc/data/model/Study.js | 47 ------------------- .../class/osparc/desktop/StudyEditor.js | 12 +---- 3 files changed, 2 insertions(+), 61 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/Resources.js b/services/static-webserver/client/source/class/osparc/data/Resources.js index 749e445cdbb..f2d68b21418 100644 --- a/services/static-webserver/client/source/class/osparc/data/Resources.js +++ b/services/static-webserver/client/source/class/osparc/data/Resources.js @@ -191,10 +191,6 @@ qx.Class.define("osparc.data.Resources", { method: "PATCH", url: statics.API + "/projects/{studyId}" }, - put: { - method: "PUT", - url: statics.API + "/projects/{studyId}" - }, delete: { method: "DELETE", url: statics.API + "/projects/{studyId}" diff --git a/services/static-webserver/client/source/class/osparc/data/model/Study.js b/services/static-webserver/client/source/class/osparc/data/model/Study.js index 9a7d406a66c..6c16d1a9851 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Study.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Study.js @@ -638,53 +638,6 @@ qx.Class.define("osparc.data.model.Study", { const studyData = this.serialize(); return studyData; }); - }, - - updateStudy: function(params) { - return new Promise((resolve, reject) => { - osparc.data.Resources.fetch("studies", "put", { - url: { - "studyId": this.getUuid() - }, - data: { - ...this.serialize(), - ...params - } - }) - .then(data => { - this.__updateModel(data); - qx.event.message.Bus.getInstance().dispatchByName("updateStudy", data); - resolve(data); - }) - .catch(err => reject(err)); - }); - }, - - __updateModel: function(data) { - if ("dev" in data) { - delete data["dev"]; - } - Object.keys(data).forEach(key => { - if (this.self().IgnoreModelizationProps.includes(key)) { - delete data[key]; - } - }); - - this.set({ - ...data, - creationDate: new Date(data.creationDate), - lastChangeDate: new Date(data.lastChangeDate), - workbench: this.getWorkbench(), - ui: this.getUi() - }); - - const nodes = this.getWorkbench().getNodes(); - Object.values(nodes).forEach(node => { - const nodeId = node.getNodeId(); - if (nodeId in data.workbench) { - node.populateStates(data.workbench[nodeId]); - } - }); } } }); diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 02f7604615d..2265b60c2fd 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -759,16 +759,8 @@ qx.Class.define("osparc.desktop.StudyEditor", { } this.__updatingStudy++; - let updatePromise = null; - if (osparc.utils.Utils.isDevelopmentPlatform()) { - // For now, master deployment only - const studyDiffs = this.__getStudyDiffs(); - updatePromise = this.getStudy().patchStudyDelayed(studyDiffs) - } else { - const newObj = this.getStudy().serialize(); - updatePromise = this.getStudy().updateStudy(newObj); - } - return updatePromise + const studyDiffs = this.__getStudyDiffs(); + return this.getStudy().patchStudyDelayed(studyDiffs) .then(studyData => this.__setStudyDataInBackend(studyData)) .catch(error => { if ("status" in error && error.status === 409) {