Skip to content

Commit b7a61ce

Browse files
committed
more refactoring
1 parent 4f47814 commit b7a61ce

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,18 @@ qx.Class.define("osparc.store.Study", {
218218
console.error("Failed to fetch pricing units:", err);
219219
throw err;
220220
});
221-
}
221+
},
222+
223+
updateSelectedPricingUnit: function(studyId, nodeId, planId, selectedUnitId) {
224+
const params = {
225+
url: {
226+
studyId,
227+
nodeId,
228+
pricingPlanId: planId,
229+
pricingUnitId: selectedUnitId
230+
}
231+
};
232+
return osparc.data.Resources.fetch("studies", "putPricingUnit", params);
233+
},
222234
}
223235
});

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,7 @@ qx.Class.define("osparc.study.NodePricingUnits", {
7474

7575
statics: {
7676
patchPricingUnitSelection: function(studyId, nodeId, planId, selectedUnitId) {
77-
const params = {
78-
url: {
79-
studyId,
80-
nodeId,
81-
pricingPlanId: planId,
82-
pricingUnitId: selectedUnitId
83-
}
84-
};
85-
return osparc.data.Resources.fetch("studies", "putPricingUnit", params);
77+
return osparc.store.Study.updateSelectedPricingUnit(studyId, nodeId, planId, selectedUnitId);
8678
}
8779
},
8880

0 commit comments

Comments
 (0)