Commit 8427dc83 authored by pestov's avatar pestov
Browse files

fix: check if image key is present at API response

parent fbd62e92
Pipeline #230325 passed with stages
in 4 minutes and 6 seconds
...@@ -267,23 +267,24 @@ export default { ...@@ -267,23 +267,24 @@ export default {
this.$root.$emit('manifest-changed'); this.$root.$emit('manifest-changed');
} }
this.imageurl = data.image.id || '';
if (data.annotationCollection) { if (data.annotationCollection) {
this.getAnnotations(data.annotationCollection); this.getAnnotations(data.annotationCollection);
} }
fetch(this.imageurl).then((response) => { if (data.image) {
if (response.status === 200 || response.status === 201) { this.imageurl = data.image.id || '';
this.errormessage = false; fetch(this.imageurl).then((response) => {
} else { if (response.status === 200 || response.status === 201) {
// for vpn error. this.errormessage = false;
} else {
// for vpn error.
this.errormessage = true;
}
}).catch(() => {
// for CORS error.
this.errormessage = true; this.errormessage = true;
} });
}).catch(() => { }
// for CORS error.
this.errormessage = true;
});
}); });
}, },
/** /**
......
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