fix Diagnosis first run

This commit is contained in:
Axolotle 2020-11-24 12:46:21 +01:00
parent 7b33b223b6
commit 20f1ae62f7

View file

@ -86,7 +86,7 @@
</b-button> </b-button>
<b-button <b-button
v-if="details" v-if="details"
size="sm" variant="light" class="ml-lg-2 mt-2 mt-lg-0" size="sm" variant="outline-dark" class="ml-lg-2 mt-2 mt-lg-0"
v-b-toggle="'collapse-' + id + '-item-' + i" v-b-toggle="'collapse-' + id + '-item-' + i"
> >
<icon iname="level-down" /> <span v-t="'details'" /> <icon iname="level-down" /> <span v-t="'details'" />
@ -125,13 +125,14 @@ export default {
methods: { methods: {
fetchData () { fetchData () {
api.get('diagnosis/show?full').then(({ reports }) => { api.get('diagnosis/show?full').then((data) => {
if (!Array.isArray(reports)) { if (data === null) {
this.reports = null this.reports = null
return return
} }
for (var report of reports) { const reports = data.reports
for (const report of reports) {
report.warnings = 0 report.warnings = 0
report.errors = 0 report.errors = 0
report.ignoreds = 0 report.ignoreds = 0