- includes both users and chefs
- Query Users table where chef_id exists (gives us all chefs)
A chef can update their chef profile
A logged in user will be able to view all of their current and past reservations:
- Query Reservations table
- Reservation.user_id === user.id (logged in user's id)
- Post reservation
- get chef_id from params
- get user_id from session
- get rest of info from form
- Refer to POST
- Starting state will be generated from store
- Edit button
- Find Reservation id and delete
- A logged in chef will be able to view all of their current and past reservations:
- Query Reservations table
- Reservation.chef_id === user.id (logged in user's id)
- Query favorites table (get all favorites)
- Favorites.user_id == user.id
- Post where user_id == session.user.id and
- Get chef_id from params if they are in the chef's profile
- Or, e.target.id
- Find favorite id and delete
A logged in user will be able to view all of their reviews by clicking on a reviews button
- Query Reviews table
- Reviews.user_id == user.id
On the user profile page, there will be a button on past reservations. The user can click on that button to add a review for that chef.
- Grab info from the form
Have an edit button that the user clicks on.
- Find reviews id and delete
A chef will be able to view all of their reviews on their profile page:
- Query Reviews table
- Reviews.chef_id == user.id
- Query Food-types table
- Get all
Session User Profile Page
- If session.user.chef_id
- Get chef info from Chef store
- else
- Get session.user info
- User sees all of their own reviews for all chefs
- Click on a chef's profile page - dispatch action creator to display all reviews