Skip to content

Commit

Permalink
add search food error checking, and update nav bar link:
Browse files Browse the repository at this point in the history
  • Loading branch information
allen-liaoo committed Apr 22, 2024
1 parent 86c6eb6 commit 6259416
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function NavBar() {
<div className={styles.navbar}>


<Link to="/food/create" className={styles.navlink}>Food</Link>
<Link to="/foods" className={styles.navlink}>Food</Link>
<Link to="/recipes" className={styles.navlink}>Recipe</Link>
<Link to="/queue" className={styles.navlink}>Queue</Link>
<Link to="/" className={styles.navlink}>My Account</Link>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/food/CreateFood.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export default function CreateFood() {
},
body: JSON.stringify({food: food})
})
if (!res.ok) {
window.alert("Failed searching food!")
return
}
const foods = await res.json()
console.log(foods)
setResults(foods.data)
Expand Down

0 comments on commit 6259416

Please sign in to comment.