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) {
let path = "/" + ownertype;
if (ownername) {
path += "/" + ownername;
}
let path =
"/projectgroups/" + encodeURIComponent(ownertype + "/" + ownername);
path += "/projects";
fetch(apiurl(path))
.then(res => res.json())
.then(res => {
console.log(res);
let projects = res.projects.map(function(project) {
let projects = res.map(function(project) {
return project;
});
this.projects = projects;

View File

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

View File

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