Commit 45fe0d45 authored by Thomas Beermann's avatar Thomas Beermann
Browse files

show all softwares for a services #97

parent 8033aac1
Pipeline #96208 passed with stages
in 16 minutes and 40 seconds
......@@ -229,15 +229,22 @@ class ServiceCard extends LitElement
.then(data => {
this.abbreviation = data.abbreviation;
});
fetch(`${window.location.origin}${cp_prefix}api/v0/software/${this.service.softwareList[0]}`, {headers: headers})
.then((response) => {
if (response.status !== 200) {
throw new Error(`Looks like there was a problem. Status Code: ${response.status}`);
}
return response.json();
})
.then(data => {
this.software = data.name;
var softwares = [];
this.service.softwareList.forEach(uuid => {
fetch(`${window.location.origin}${cp_prefix}api/v0/software/${uuid}`, {headers: headers})
.then((response) => {
if (response.status !== 200) {
throw new Error(`Looks like there was a problem. Status Code: ${response.status}`);
}
return response.json();
})
.then(data => {
softwares.push(data.name);
this.software = softwares.join(", ");
})
.catch(e => {
console.log(e);
});
});
}
......
......@@ -134,19 +134,23 @@ class ServiceProfile extends LitElement
return data;
})
.then(data => {
fetch(`${window.location.origin}${cp_prefix}api/v0/software/${this.service.softwareList[0]}`, {headers: headers})
.then((response) => {
if (response.status !== 200) {
throw new Error(`Looks like there was a problem. Status Code: ${response.status}`);
}
return response.json();
})
.then(data => {
this.software = data.name;
var softwares = [];
data.softwareList.forEach(uuid => {
fetch(`${window.location.origin}${cp_prefix}api/v0/software/${uuid}`, {headers: headers})
.then((response) => {
if (response.status !== 200) {
throw new Error(`Looks like there was a problem. Status Code: ${response.status}`);
}
return response.json();
})
.then(data => {
softwares.push(data.name);
this.software = softwares.join(", ");
})
.catch(e => {
console.log(e);
});
})
.catch(e => {
console.log(e);
});
})
.catch(e => {
console.log(e);
......
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