1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00

🐛 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 8c39ebfd8b
commit 99c60d5060

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');
});