1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00
- bugfix
- Alert message added(Private planet/Team member)
This commit is contained in:
Rokt33r
2015-08-24 13:45:28 +09:00
parent bfdf691bed
commit 15133d00c7
6 changed files with 52 additions and 37 deletions

View File

@@ -50,19 +50,24 @@ module.exports = React.createClass({
}
},
handleSubmit: function () {
Hq
.addMember(this.props.team.name, {
userName: this.state.userName,
role: this.state.role
})
.then(function (res) {
console.log(res.body)
UserStore.Actions.addMember(res.body)
this.props.close()
}.bind(this))
.catch(function (err) {
console.error(err)
})
this.setState({errorMessage: null}, function () {
Hq
.addMember(this.props.team.name, {
userName: this.state.userName,
role: this.state.role
})
.then(function (res) {
console.log(res.body)
UserStore.Actions.addMember(res.body)
this.props.close()
}.bind(this))
.catch(function (err) {
console.error(err)
if (err.status === 403) {
this.setState({errorMessage: err.response.body.message})
}
}.bind(this))
})
},
handleChange: function (value) {
this.setState({userName: value})
@@ -88,6 +93,8 @@ module.exports = React.createClass({
role
</div>
{this.state.errorMessage != null ? (<p className='errorAlert'>{this.state.errorMessage}</p>) : null}
<button onClick={this.handleSubmit} className='submitButton'><i className='fa fa-check'/></button>
</div>
)