Load proper subscriber filters on save
[MAILPOET-3054]
This commit is contained in:
committed by
Veljko V
parent
fb3b6f8239
commit
7d94e2fbbd
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation, useHistory } from 'react-router-dom';
|
||||||
import MailPoet from 'mailpoet';
|
import MailPoet from 'mailpoet';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
@@ -211,11 +211,13 @@ function afterFormContent(values) {
|
|||||||
|
|
||||||
const SubscriberForm = ({ match }) => {
|
const SubscriberForm = ({ match }) => {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
const history = useHistory();
|
||||||
|
const backUrl = location.state?.backUrl || '/';
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1 className="title">
|
<h1 className="title">
|
||||||
{MailPoet.I18n.t('subscriber')}
|
{MailPoet.I18n.t('subscriber')}
|
||||||
<Link className="page-title-action" to={location.state?.backUrl || '/'}>{MailPoet.I18n.t('backToList')}</Link>
|
<Link className="page-title-action" to={backUrl}>{MailPoet.I18n.t('backToList')}</Link>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<SubscribersLimitNotice />
|
<SubscribersLimitNotice />
|
||||||
@@ -228,6 +230,7 @@ const SubscriberForm = ({ match }) => {
|
|||||||
messages={messages}
|
messages={messages}
|
||||||
beforeFormContent={beforeFormContent}
|
beforeFormContent={beforeFormContent}
|
||||||
afterFormContent={afterFormContent}
|
afterFormContent={afterFormContent}
|
||||||
|
onSuccess={() => history.push(backUrl)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user