dailylog 07-27-21

less than 1 minute read

210. Making an API Request

  1. Add try catch statement to signup
  2. 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!)
  3. in SignupScreen import useContext
  4. import CONTEXT as Auth Conted from “authcontext”
  5. destructure { state, signup } from useContext(AuthContext)
  6. add onPress to button and pass in the function to signup and pass in {email, password}

GOALS:

  1. Fake sign up with an email and password not in the system yet, get a token
  2. Attempt to sign up with same email as test 1, get a 422 error

Tags:

Updated: