Skip to content

Commit 811e560

Browse files
committed
minors
1 parent 1d555ed commit 811e560

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

services/static-webserver/client/source/class/osparc/desktop/credits/CheckoutsTableModel.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ qx.Class.define("osparc.desktop.credits.CheckoutsTableModel", {
5252
orderBy: {
5353
check: "Object",
5454
init: {
55-
field: "purchased_at",
55+
field: "startAt",
5656
direction: "desc"
5757
}
5858
}
@@ -61,7 +61,7 @@ qx.Class.define("osparc.desktop.credits.CheckoutsTableModel", {
6161
statics: {
6262
SERVER_MAX_LIMIT: 49,
6363
COLUMN_ID_TO_DB_COLUMN_MAP: {
64-
0: "purchased_at",
64+
0: "startAt",
6565
},
6666
},
6767

@@ -83,15 +83,15 @@ qx.Class.define("osparc.desktop.credits.CheckoutsTableModel", {
8383
limit: 1,
8484
filters: this.getFilters() ?
8585
JSON.stringify({
86-
"started_at": this.getFilters()
86+
"startAt": this.getFilters()
8787
}) :
8888
null,
8989
orderBy: JSON.stringify(this.getOrderBy()),
9090
};
9191
const options = {
9292
resolveWResponse: true
9393
};
94-
osparc.store.LicensedItems.getInstance().getPurchasedLicensedItems(walletId, urlParams, options)
94+
osparc.store.LicensedItems.getInstance().getCheckedOutLicensedItems(walletId, urlParams, options)
9595
.then(resp => {
9696
this._onRowCountLoaded(resp["_meta"].total)
9797
})
@@ -120,7 +120,7 @@ qx.Class.define("osparc.desktop.credits.CheckoutsTableModel", {
120120
};
121121
const licensedItemsStore = osparc.store.LicensedItems.getInstance();
122122
return Promise.all([
123-
licensedItemsStore.getLicensedItems(),
123+
licensedItemsStore.getCheckedOutLicensedItems(),
124124
licensedItemsStore.getPurchasedLicensedItems(walletId, urlParams),
125125
licensedItemsStore.getVipModels(),
126126
])

services/static-webserver/client/source/class/osparc/desktop/credits/PurchasesTableModel.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ qx.Class.define("osparc.desktop.credits.PurchasesTableModel", {
5252
orderBy: {
5353
check: "Object",
5454
init: {
55-
field: "purchased_at",
55+
field: "startAt",
5656
direction: "desc"
5757
}
5858
}
@@ -61,7 +61,7 @@ qx.Class.define("osparc.desktop.credits.PurchasesTableModel", {
6161
statics: {
6262
SERVER_MAX_LIMIT: 49,
6363
COLUMN_ID_TO_DB_COLUMN_MAP: {
64-
0: "purchased_at",
64+
0: "startAt",
6565
},
6666
},
6767

@@ -83,7 +83,7 @@ qx.Class.define("osparc.desktop.credits.PurchasesTableModel", {
8383
limit: 1,
8484
filters: this.getFilters() ?
8585
JSON.stringify({
86-
"started_at": this.getFilters()
86+
"startAt": this.getFilters()
8787
}) :
8888
null,
8989
orderBy: JSON.stringify(this.getOrderBy()),

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ qx.Class.define("osparc.store.LicensedItems", {
105105
return osparc.data.Resources.fetch("licensedItems", "purchase", params);
106106
},
107107

108+
getCheckedOutLicensedItems: function(walletId, urlParams, options = {}) {
109+
let purchasesParams = {
110+
url: {
111+
walletId,
112+
offset: 0,
113+
limit: 49,
114+
}
115+
};
116+
if (urlParams) {
117+
purchasesParams.url = Object.assign(purchasesParams.url, urlParams);
118+
}
119+
return osparc.data.Resources.fetch("licensedItems", "checkouts", purchasesParams, options);
120+
},
121+
108122
__fetchVipModels: async function(vipSubset) {
109123
if (!(vipSubset in this.self().VIP_MODELS)) {
110124
return [];

0 commit comments

Comments
 (0)