Skip to content

Commit f77a94e

Browse files
committed
payDebt
1 parent 8f47eee commit f77a94e

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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,19 @@ qx.Class.define("osparc.store.Study", {
185185
return Boolean(this.getStudyDebt(studyId));
186186
},
187187

188+
payDebt: function(studyId, walletId, amount) {
189+
const params = {
190+
url: {
191+
studyId,
192+
walletId,
193+
},
194+
data: {
195+
amount,
196+
}
197+
};
198+
return osparc.data.Resources.fetch("studies", "payDebt", params);
199+
},
200+
188201
trashStudy: function(studyId) {
189202
const params = {
190203
url: {

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,7 @@ qx.Class.define("osparc.study.BillingSettings", {
238238

239239
__doTransferCredits: function() {
240240
const wallet = this.__getSelectedWallet();
241-
const params = {
242-
url: {
243-
studyId: this.__studyData["uuid"],
244-
walletId: wallet.getWalletId(),
245-
},
246-
data: {
247-
amount: this.__studyData["debt"],
248-
}
249-
};
250-
osparc.data.Resources.fetch("studies", "payDebt", params)
241+
osparc.store.Study.getInstance().payDebt(this.__studyData["uuid"], walletId, this.__studyData["debt"])
251242
.then(() => {
252243
// at this point we can assume that the study got unblocked
253244
this.__debtPayed();

0 commit comments

Comments
 (0)