Many improvements in SelectionMap
This commit is contained in:
parent
7a672bca87
commit
e3eddd6b85
13 changed files with 173 additions and 132 deletions
|
|
@ -30,16 +30,22 @@ class SubscriptionEditor extends React.Component {
|
|||
|
||||
if (existingSubscription) doc._id = existingSubscription;
|
||||
|
||||
Meteor.call(methodToCall, doc, (error, subscriptionId) => {
|
||||
if (error) {
|
||||
Bert.alert(error.reason, 'danger');
|
||||
} else {
|
||||
const confirmation = existingSubscription ? t('Zona actualizada') : t('Zona añadida');
|
||||
Bert.alert(confirmation, 'success');
|
||||
// history.push(`/subscriptions/${subscriptionId}`);
|
||||
history.push('/subscriptions');
|
||||
}
|
||||
});
|
||||
const authenticated = !!Meteor.userId();
|
||||
|
||||
if (authenticated) {
|
||||
Meteor.call(methodToCall, doc, (error, subscriptionId) => {
|
||||
if (error) {
|
||||
Bert.alert(error.reason, 'danger');
|
||||
} else {
|
||||
const confirmation = existingSubscription ? t('Zona actualizada') : t('Zona añadida');
|
||||
Bert.alert(confirmation, 'success');
|
||||
// history.push(`/subscriptions/${subscriptionId}`);
|
||||
history.push('/subscriptions');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.props.history.push('/signup', doc);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue