dailylog 07-27-21
210. Making an API Request
- Add try catch statement to signup
- in the try, add an await where we are going to make a post request to the tracker Api (which we imported above) (don’t forget to add an async!)
- in SignupScreen import useContext
- import CONTEXT as Auth Conted from “authcontext”
- destructure { state, signup } from useContext(AuthContext)
- add onPress to button and pass in the function to signup and pass in {email, password}
GOALS:
- Fake sign up with an email and password not in the system yet, get a token
- Attempt to sign up with same email as test 1, get a 422 error