🐛 Fixed missing errors on failed import

no issue
- bug was introduced in https://github.com/TryGhost/Ghost-Admin/pull/902 where the change to `response.payload.errors` from `error.errors` was missed
This commit is contained in:
Kevin Ansfield 2017-11-16 14:04:33 +00:00
parent 18614c39f6
commit 93071cb2e4

View File

@ -156,13 +156,14 @@ export default Controller.extend({
});
}).catch((response) => {
if (isUnsupportedMediaTypeError(response) || isRequestEntityTooLargeError(response)) {
this.set('importErrors', [response]);
return;
return this.set('importErrors', [response]);
}
if (response && response.errors && isEmberArray(response.errors)) {
this.set('importErrors', response.errors);
if (response && response.payload.errors && isEmberArray(response.payload.errors)) {
return this.set('importErrors', response.payload.errors);
}
throw response;
}).finally(() => {
this.set('uploadButtonText', 'Import');
});