Skip to content

Commit b475016

Browse files
committed
getPricingUnit
1 parent 41bd768 commit b475016

File tree

1 file changed

+6
-5
lines changed
  • services/static-webserver/client/source/class/osparc/store

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,13 @@ qx.Class.define("osparc.store.Study", {
221221
}
222222
};
223223
return osparc.data.Resources.fetch("studies", "getPricingUnit", params)
224-
.then(pricingUnits => {
225-
if (pricingUnits && pricingUnits["pricingUnits"]) {
226-
return pricingUnits["pricingUnits"];
227-
} else {
228-
throw new Error("No pricing units found");
224+
.then(selectedPricingUnit => {
225+
// store the fetched pricing unit in the cache
226+
if (!(studyId in this.__nodePricingUnit)) {
227+
this.__nodePricingUnit[studyId] = {};
229228
}
229+
this.__nodePricingUnit[studyId][nodeId] = selectedPricingUnit;
230+
return selectedPricingUnit;
230231
})
231232
.catch(err => {
232233
console.error("Failed to fetch pricing units:", err);

0 commit comments

Comments
 (0)