Skip to content
Snippets Groups Projects
Commit 63fcb64e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

default max count of search results is used in api calls when value is undefined

parent 2a8d3c2b
No related branches found
No related tags found
1 merge request!181default max count of search results is used in api calls when value is undefined
......@@ -11,6 +11,7 @@ var ConfigurationType = {
REQUEST_ACCOUNT_EMAIL: "REQUEST_ACCOUNT_EMAIL",
SIMPLE_COLOR_VAL: "SIMPLE_COLOR_VAL",
SEARCH_DISTANCE: "SEARCH_DISTANCE",
SEARCH_RESULT_NUMBER: "SEARCH_RESULT_NUMBER",
USER_MANUAL_FILE: "USER_MANUAL_FILE",
};
......
......@@ -999,6 +999,13 @@ ServerConnector.getElementsByQuery = function (params) {
return self.getProjectId(params.projectId).then(function (result) {
queryParams.projectId = result;
return self.getConfigurationParam(ConfigurationType.SEARCH_RESULT_NUMBER);
}).then(function (defaultCount) {
if (params.count !== undefined) {
filterParams.count = params.count;
} else {
filterParams.count = defaultCount;
}
return self.readFile(self.getSearchUrl(queryParams, filterParams));
}).then(function (content) {
var array = JSON.parse(content);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment