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: {
|
||||
id: subscriber.id,
|
||||
},
|
||||
}).done(() => {
|
||||
MailPoet.Notice.success(MailPoet.I18n.t('oneConfirmationEmailSent'));
|
||||
}).fail((response) => {
|
||||
if (response.errors.length > 0) {
|
||||
MailPoet.Notice.error(
|
||||
response.errors.map((error) => error.message),
|
||||
{ scroll: true }
|
||||
);
|
||||
}
|
||||
});
|
||||
})
|
||||
.done(() => MailPoet.Notice.success(MailPoet.I18n.t('oneConfirmationEmailSent')))
|
||||
.fail((response) => MailPoet.Notice.showApiErrorNotice(response));
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user