Commit f08d1cb7 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

JS get list of overlays from new place

parent 5cc821d7
......@@ -327,14 +327,10 @@ ServerConnector.deleteOverlayUrl = function() {
});
};
ServerConnector.getOverlaysUrl = function(projectId, token) {
ServerConnector.getOverlaysUrl = function(queryParams, filterParams) {
return this.getApiUrl({
type : "overlay",
method : "getOverlayList",
params : {
projectId : projectId,
token : token,
},
url : this.getProjectsUrl(queryParams) + "overlays/",
params : filterParams,
});
};
......@@ -798,12 +794,15 @@ ServerConnector.getUser = function(userId) {
ServerConnector.getOverlays = function(projectId) {
var self = this;
var queryParams = {};
var filterParams = {};
return new Promise(function(resolve, reject) {
self.getProjectId(projectId).then(function(result) {
projectId = result;
queryParams.projectId = result;
return self.getToken();
}).then(function(token) {
return self.readFile(self.getOverlaysUrl(projectId, token));
filterParams.token = token;
return self.readFile(self.getOverlaysUrl(queryParams, filterParams));
}).then(function(content) {
var arr = JSON.parse(content);
var result = [];
......
Markdown is supported
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