Zhusufeng / meal-generator

A meal planning tool
https://meal-generator-nine.vercel.app
0 stars 0 forks source link

Build "Meal Plan" page #6

Open Zhusufeng opened 12 months ago

Zhusufeng commented 12 months ago

It should be focused for now on a single user view with 1 day and only 1 meal. Let's hardcode the day.

Build the API to get the user's meal for that day. Build the UI to show the user's meal.

Tasks:

Zhusufeng commented 6 months ago

GET /meals It will get all the meals for the day for a user.

Request:

/meals?userId=user_id&date=2024-01-04...

Response:

[
  {
    "_id": "user_meal_id_1",
    "userId": "user_id_1",
    "mealDate": "2023-07-05",
    "mealType": "meal_type_id_1",
    "entrees": ["dish_id_1"],
    "sides": ["dish_id_2"],
    "createdAt": "2023-07-03",
    "updatedAt": "2023-07-03"
  }
]

This may change in the future

Zhusufeng commented 6 months ago

POST /meals This will add meal for a user for a date.

Request:

{
    userId: "user_id",
    "mealDate": "2023-07-05",
    "mealType": "meal_type_id_1",
    "entrees": ["dish_id_1"],
    "sides": ["dish_id_2"],
    "createdAt": "2023-07-03",
    "updatedAt": "2023-07-03"
}

Response:

{
  success: true,
  data: {
     userId: "user_id",
     "mealDate": "2023-07-05",
     "mealType": "meal_type_id_1",
     "entrees": ["dish_id_1"],
     "sides": ["dish_id_2"],
     "createdAt": "2023-07-03",
     "updatedAt": "2023-07-03"
  }
}