Skip to content

Commit 25eab2b

Browse files
committed
fix edit pricing plan
1 parent 40a2db1 commit 25eab2b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

services/static-webserver/client/source/class/osparc/pricing/PlanEditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ qx.Class.define("osparc.pricing.PlanEditor", {
3636
manager.add(name);
3737

3838
if (pricingPlan) {
39-
this.__pricingPlan = osparc.utils.Utils.deepCloneObject(pricingPlan);
39+
this.__pricingPlan = pricingPlan;
4040
this.set({
4141
ppKey: pricingPlan.getPricingPlanKey(),
4242
name: pricingPlan.getName(),
@@ -235,7 +235,7 @@ qx.Class.define("osparc.pricing.PlanEditor", {
235235
"classification": this.getClassification(),
236236
"isActive": this.getIsActive(),
237237
};
238-
osparc.store.Pricing.getInstance().putPricingPlan(this.__pricingPlan["pricingPlanId"], updateData)
238+
osparc.store.Pricing.getInstance().putPricingPlan(this.__pricingPlan.getPricingPlanId(), updateData)
239239
.then(() => {
240240
osparc.FlashMessenger.logAs(this.tr("Successfully updated"));
241241
this.fireEvent("done");

services/static-webserver/client/source/class/osparc/pricing/Plans.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,17 @@ qx.Class.define("osparc.pricing.Plans", {
125125
},
126126

127127
__openUpdatePricingPlan: function(pricingPlanId) {
128-
osparc.store.Pricing.getInstance().fetchPricingUnits(pricingPlanId)
129-
.then(pricingPlan => {
130-
const ppEditor = new osparc.pricing.PlanEditor(pricingPlan);
131-
const title = this.tr("Pricing Plan Editor");
132-
const win = osparc.ui.window.Window.popUpInWindow(ppEditor, title, 400, 250);
133-
ppEditor.addListener("done", () => {
134-
win.close();
135-
this.fetchPlans();
136-
});
137-
ppEditor.addListener("cancel", () => win.close());
128+
const pricingPlan = osparc.store.Pricing.getInstance().getPricingPlan(pricingPlanId);
129+
if (pricingPlan) {
130+
const ppEditor = new osparc.pricing.PlanEditor(pricingPlan);
131+
const title = this.tr("Pricing Plan Editor");
132+
const win = osparc.ui.window.Window.popUpInWindow(ppEditor, title, 400, 250);
133+
ppEditor.addListener("done", () => {
134+
win.close();
135+
this.fetchPlans();
138136
});
137+
ppEditor.addListener("cancel", () => win.close());
138+
}
139139
}
140140
}
141141
});

0 commit comments

Comments
 (0)