Nicer code for showing API error message
[MAILPOET-2316]
This commit is contained in:
committed by
Jack Kitterhing
parent
4d931bfb0e
commit
ed971dd4dd
@@ -239,16 +239,9 @@ const itemActions = [
|
|||||||
data: {
|
data: {
|
||||||
id: subscriber.id,
|
id: subscriber.id,
|
||||||
},
|
},
|
||||||
}).done(() => {
|
})
|
||||||
MailPoet.Notice.success(MailPoet.I18n.t('oneConfirmationEmailSent'));
|
.done(() => MailPoet.Notice.success(MailPoet.I18n.t('oneConfirmationEmailSent')))
|
||||||
}).fail((response) => {
|
.fail((response) => MailPoet.Notice.showApiErrorNotice(response));
|
||||||
if (response.errors.length > 0) {
|
|
||||||
MailPoet.Notice.error(
|
|
||||||
response.errors.map((error) => error.message),
|
|
||||||
{ scroll: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user