Commit 25d0e0d9 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '265-max-numbers-of-results' into 'devel_11.0.x'

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

See merge request piotr.gawron/minerva!181
parents 2a8d3c2b 63fcb64e
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment