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 {
this.$root.$emit('manifest-changed');
}
this.imageurl = data.image.id || '';
if (data.annotationCollection) {
this.getAnnotations(data.annotationCollection);
}
fetch(this.imageurl).then((response) => {
if (response.status === 200 || response.status === 201) {
this.errormessage = false;
} else {
// for vpn error.
if (data.image) {
this.imageurl = data.image.id || '';
fetch(this.imageurl).then((response) => {
if (response.status === 200 || response.status === 201) {
this.errormessage = false;
} else {
// for vpn error.
this.errormessage = true;
}
}).catch(() => {
// for CORS error.
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