Skip to content

Commit 1243603

Browse files
committed
searchFunctionsPaginated
1 parent 2db9de3 commit 1243603

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
952952
case osparc.dashboard.StudyBrowser.CONTEXT.FUNCTIONS:
953953
request = osparc.store.Functions.fetchFunctionsPaginated(params, options);
954954
break;
955+
case osparc.dashboard.StudyBrowser.CONTEXT.SEARCH_FUNCTIONS:
956+
request = osparc.store.Functions.searchFunctionsPaginated(params, options);
957+
break;
955958
}
956959
return request;
957960
},

services/static-webserver/client/source/class/osparc/data/Resources.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,10 @@ qx.Class.define("osparc.data.Resources", {
636636
method: "GET",
637637
url: statics.API + "/functions?include_extras=true&offset={offset}&limit={limit}"
638638
},
639+
getPageSearch: {
640+
method: "GET",
641+
url: statics.API + "/functions:search?include_extras=true&offset={offset}&limit={limit}&text={text}"
642+
},
639643
create: {
640644
method: "POST",
641645
url: statics.API + "/functions"

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@ qx.Class.define("osparc.store.Functions", {
122122
});
123123
},
124124

125+
searchFunctionsPaginated: function(params, options) {
126+
if ("orderBy" in params["url"]) {
127+
params["url"]["orderBy"] = this.curateOrderBy(params["url"]["orderBy"]);
128+
}
129+
return osparc.data.Resources.fetch("functions", "getPageSearch", params, options)
130+
.then(response => {
131+
const functions = response["data"];
132+
functions.forEach(func => func["resourceType"] = "function");
133+
return response;
134+
});
135+
},
136+
125137
fetchFunction: function(functionId) {
126138
const params = {
127139
url: {

0 commit comments

Comments
 (0)