Skip to content

Commit

Permalink
replace placeholder createTeam function with link to /teams/create
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvincent committed Aug 22, 2019
1 parent 06b7a9e commit 73e3d85
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions pages/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,6 @@ export default class Profile extends Component {
}
}

async createTeam () {
let res = await fetch(join(URL, '/api/teams'), {
method: 'POST',
body: JSON.stringify({
name: `${chance.country({ full: true })} ${chance.animal()} ${chance.pickone([
'Group', 'Inc.', 'Ltd.', 'Team', 'Associates', 'Party', 'LLC', 'Corp.'
]
)}`,
hashtag: chance.hashtag()
}),
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
})
if (res.status === 200) {
await this.refreshTeams()
} else {
throw new Error('Could not create new team')
}
}

componentDidMount () {
this.refreshTeams()
}
Expand Down Expand Up @@ -97,7 +76,7 @@ export default class Profile extends Component {
<div className='inner page'>
<div className='page__heading'>
<h2>Profile</h2>
<Button variant='primary' onClick={() => this.createTeam()} >Create team</Button>
<Button variant='primary' href='/teams/create' >Create team</Button>
</div>
<Section>
<SectionHeader>Your Teams</SectionHeader>
Expand Down

0 comments on commit 73e3d85

Please sign in to comment.