From 73e3d8594282f685ce144533382b3c2af087448e Mon Sep 17 00:00:00 2001 From: sethvincent Date: Thu, 22 Aug 2019 15:31:08 -0700 Subject: [PATCH 1/2] replace placeholder createTeam function with link to /teams/create --- pages/profile.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/pages/profile.js b/pages/profile.js index d399b986..b6c95a71 100644 --- a/pages/profile.js +++ b/pages/profile.js @@ -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() } @@ -97,7 +76,7 @@ export default class Profile extends Component {

Profile

- +
Your Teams From 6fd188c19b9864093de46f1ee527213aab4cc0c4 Mon Sep 17 00:00:00 2001 From: sethvincent Date: Thu, 22 Aug 2019 15:33:11 -0700 Subject: [PATCH 2/2] lintfix --- pages/profile.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/pages/profile.js b/pages/profile.js index b6c95a71..17440230 100644 --- a/pages/profile.js +++ b/pages/profile.js @@ -3,12 +3,10 @@ import Router from 'next/router' import join from 'url-join' import getConfig from 'next/config' import Button from '../components/button' -import Chance from 'chance' import Section from '../components/section' import SectionHeader from '../components/section-header' import Table from '../components/table' import { getTeams } from '../lib/teams-api' -const chance = Chance() const { publicRuntimeConfig } = getConfig() const URL = publicRuntimeConfig.APP_URL