Commit 7b0b7a8e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

client side use new get reactions api

parent ebe9d361
......@@ -456,24 +456,6 @@ ServerConnector.getBioEntitiesUrl = function(params) {
});
};
ServerConnector.getReactionsUrl = function(params) {
var id = this.idsToString(params.ids);
var columns = this.columnsToString(params.columns);
var participantId = this.idsToString(params.participantId);
return this.getApiUrl({
type : "project",
method : "getReactions",
params : {
projectId : params.projectId,
token : params.token,
columns : columns,
id : id,
participantId : participantId,
},
});
};
ServerConnector.getIdOrAsterisk = function(id) {
if (id === undefined || id === "" || id === null) {
return "*";
......@@ -482,6 +464,20 @@ ServerConnector.getIdOrAsterisk = function(id) {
}
}
ServerConnector.getReactionsUrl = function(queryParams, filterParams) {
var params = {};
params.id = this.idsToString(filterParams.ids);
params.columns = this.columnsToString(filterParams.columns);
params.token = filterParams.token;
params.participantId = filterParams.participantId;
return this.getApiUrl({
url : this.getBioEntitiesUrl(queryParams) + "reactions/",
params : params,
});
};
ServerConnector.getAliasesUrl = function(queryParams, filterParams) {
var params = {};
params.id = this.idsToString(filterParams.ids);
......@@ -959,12 +955,18 @@ ServerConnector.getOverlayById = function(layoutId, projectId) {
ServerConnector.getReactions = function(params) {
var self = this;
var queryParams = {};
var filterParams = {
ids : params.ids,
columns : params.columns,
participantId:params.participantId,
};
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.getReactionsUrl(params));
filterParams.token = token;
return self.readFile(self.getReactionsUrl(queryParams, filterParams));
}).then(function(content) {
var array = JSON.parse(content);
var result = [];
......
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