1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 08:37:59 +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}
handleSuccess={this.props.handleSuccess} />
<DeleteButton
handleSuccess={this.props.handleSuccess}
editions={this.props.editions}/>
{this.props.children}
</div>

View File

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