Skip to content

Commit

Permalink
Merge pull request #22 from nadinCodeHat/feat/backend
Browse files Browse the repository at this point in the history
Feat/backend
  • Loading branch information
nadinCodeHat authored Mar 4, 2022
2 parents 948fb92 + 7b58538 commit da23f49
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
@api.route('/profile')
def my_profile():
response_body = {
"name": "Nagato",
"about" :"Hello! I'm a full stack developer that loves python and javascript"
"name": "Nadin",
"about" :"Hello World"
}

return response_body
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"scripts": {
"start": "react-scripts start",
"start-api": "cd api && venv/Scripts/flask run --no-debugger",
"start-api": "cd api && venv\\Scripts\\flask run --no-debugger",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand Down
10 changes: 6 additions & 4 deletions src/pages/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function Home() {
);

// new line start
const [profileData, setProfileData] = useEffect(null);
const [profileData, setProfileData] = useState(null);

function getData() {
axios({
Expand Down Expand Up @@ -147,7 +147,7 @@ export default function Home() {
autoFocus={true}
fullWidth
rows={13}
value={this.state.value}
value={value}
onChange={getData}
InputProps={{
disableUnderline: true,
Expand Down Expand Up @@ -194,13 +194,15 @@ export default function Home() {
<CardContent>
<Grid container>
<Grid item xs>
{content}
{/* {content} */}
<button onClick={getData}>Click me</button>
{profileData && (
<div>
console.log('I was triggered during render')
<p>Profile name: {profileData.profile_name}</p>
<p>About me: {profileData.about_me}</p>
</div>
)}
)}
</Grid>
</Grid>
</CardContent>
Expand Down

0 comments on commit da23f49

Please sign in to comment.