simple-dashboard
simple-dashboard copied to clipboard
getStatus() for StatusCode is not working properly
It returns 'success' even for error status codes between 400 and 500.
I used the following code instead which works for me.
getStatus() {
return this.fetchData()
.catch(response => {
return response
})
.then(response => {
console.log(response)
if (response.status === 200) {
return {
title: this.title,
link: this.link,
status: "success",
messages: []
};
}
return {
title: this.title,
link: this.link,
status: "danger",
messages: [{
message: "Request failed: " + response.message || 'unknown'
}]
};
});