Commit 811cfe66 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

client side uses new api calls for publications

parent e6e46455
......@@ -259,21 +259,13 @@ ServerConnector.getModelConvertersUrl = function(params) {
});
};
ServerConnector.getPublicationsUrl = function(params) {
var projectId = params.projectId;
var token = params.token;
var start = params.start || 0;
var length = params.length || 10;
ServerConnector.getPublicationsUrl = function(queryParams, filterParams) {
filterParams.start = filterParams.start || 0;
filterParams.length = filterParams.length || 10;
return this.getApiUrl({
type : "project",
method : "getPublications",
params : {
projectId : projectId,
token : token,
start : start,
length : length,
},
url : this.getModelsUrl(queryParams) + "publications/",
params : filterParams,
});
};
......@@ -1395,12 +1387,18 @@ ServerConnector.getPublications = function(params) {
if (params === undefined) {
params = {};
}
var queryParams = {};
var filterParams = {
start : params.start,
length : params.length,
};
return self.getProjectId(params.projectId).then(function(result) {
params.projectId = result;
queryParams.projectId = result;
return self.getToken();
}).then(function(token) {
params.token = token;
return self.readFile(self.getPublicationsUrl(params));
filterParams.token = token;
return self.readFile(self.getPublicationsUrl(queryParams, filterParams));
}).then(function(content) {
return 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