update for new api

This commit is contained in:
Simone Gotti 2019-03-20 13:51:00 +01:00
parent 604a0a2a1f
commit b9fb3d6860
3 changed files with 11 additions and 17 deletions

View File

@ -39,16 +39,14 @@ export default {
} }
}, },
fetchProjects(ownertype, ownername) { fetchProjects(ownertype, ownername) {
let path = "/" + ownertype; let path =
if (ownername) { "/projectgroups/" + encodeURIComponent(ownertype + "/" + ownername);
path += "/" + ownername;
}
path += "/projects"; path += "/projects";
fetch(apiurl(path)) fetch(apiurl(path))
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {
console.log(res); console.log(res);
let projects = res.projects.map(function(project) { let projects = res.map(function(project) {
return project; return project;
}); });
this.projects = projects; this.projects = projects;

View File

@ -100,16 +100,12 @@ export default {
return "unknown"; return "unknown";
}, },
fetchProjectRuns() { fetchProjectRuns() {
fetch( let path =
apiurl( "/projects/" +
"/projects/" + encodeURIComponent(
this.ownertype + this.ownertype + "/" + this.ownername + "/" + this.projectname
"/" + );
this.ownername + fetch(apiurl(path))
"/" +
this.projectname
)
)
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {
console.log(res); console.log(res);
@ -144,7 +140,7 @@ export default {
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {
console.log(res); console.log(res);
let runs = res.runs.map(function(run) { let runs = res.map(function(run) {
return run; return run;
}); });
this.runs = runs; this.runs = runs;

View File

@ -37,7 +37,7 @@ export default {
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {
console.log("remote sources result", res); console.log("remote sources result", res);
this.remotesources = res.remote_sources; this.remotesources = res;
}); });
}, },
doLogin(rsName, username, password) { doLogin(rsName, username, password) {