1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +02:00
This commit is contained in:
diminator 2015-07-14 00:56:23 +02:00
parent 1b3f614c80
commit 3cc95cf7d5
3 changed files with 14 additions and 6 deletions

View File

@ -74,6 +74,7 @@ let AclButtonList = React.createClass({
currentUser={this.state.currentUser} currentUser={this.state.currentUser}
handleSuccess={this.props.handleSuccess} /> handleSuccess={this.props.handleSuccess} />
<DeleteButton <DeleteButton
handleSuccess={this.props.handleSuccess}
editions={this.props.editions}/> editions={this.props.editions}/>
{this.props.children} {this.props.children}
</div> </div>

View File

@ -19,18 +19,25 @@ import EditionListActions from '../../actions/edition_list_actions';
let DeleteButton = React.createClass({ let DeleteButton = React.createClass({
propTypes: { propTypes: {
editions: React.PropTypes.array.isRequired editions: React.PropTypes.array.isRequired,
handleSuccess: React.PropTypes.func
}, },
mixins: [Router.Navigation], mixins: [Router.Navigation],
showNotification(response) { showNotification(response) {
this.props.editions if (this.props.editions.constructor === Array){
.forEach((edition) => { this.props.editions
EditionListActions.fetchEditionList(edition.parent); .forEach((edition) => {
}); EditionListActions.fetchEditionList(edition.parent);
});
}
else {
EditionListActions.fetchEditionList(this.props.editions.id);
}
EditionListActions.clearAllEditionSelections(); EditionListActions.clearAllEditionSelections();
EditionListActions.closeAllEditionLists(); EditionListActions.closeAllEditionLists();
this.props.handleSuccess();
this.transitionTo('pieces'); this.transitionTo('pieces');
let notification = new GlobalNotificationModel(response.notification, 'success'); let notification = new GlobalNotificationModel(response.notification, 'success');
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);

View File

@ -16,7 +16,7 @@ let EditionRemoveFromCollectionForm = React.createClass({
return requests.prepareUrl(apiUrls.edition_remove_from_collection, {edition_id: this.getBitcoinIds().join()}); return requests.prepareUrl(apiUrls.edition_remove_from_collection, {edition_id: this.getBitcoinIds().join()});
} }
else { else {
return requests.prepareUrl(apiUrls.piece_remove_from_collection, {piece_id: this.editions.piece_id}); return requests.prepareUrl(apiUrls.piece_remove_from_collection, {piece_id: this.props.editions.id});
} }
}, },
httpVerb(){ httpVerb(){