Closed EricGraham7 closed 2 years ago
Need from HTML: Does not need anything from HTML.
Return to HTML: Will return a JSON object called results (for use on the profile.ejs page) results will contain MULTIPLE (an array of) recipes, and for each one, you will be able to access ALL of its information just like the recipes table (except as a JSON object of course)
(To be explicit, for each recipe in the JSON object, it will have: recipe_id, recipe_name, prep_time, cook_time, recipe_image(a link), recipe_ingredients, instructions, cuisine_type, rating, date_published(format?), and the booleans for vegan, vegetarian, keto, paleo, grain_free, gluten_free, contains_dairy, contains_eggs, contains_nuts, contains_soy, contains_wheat, contains_beef, contains_pork, contains_fish, and the booleans for under_30_minutes, m30_minutes_1_hour, h1_hour_2_hours, h2_hours_3_hours, h3_hours_or_more and the booleans for s1_star, s2_stars, s3_stars, s4_stars, s5_stars)
Suggestions: if you want to display all of the information for each recipe, you will need to use ALL of these except recipe_id if you don't need to display all of the information for each recipe, you can simply use whatever you need. if you wanted to, you could try to find a way to display a bunch of recipes as cards, and then when you click on one, it gives you a popup which shows all of the information. I don't know how difficult this would be.
As a user, I want to be able to automatically see all of my favorited recipes when I go to the profile page. Also, I should see my uploaded recipes in the profile.
User Acceptance Criteria: The API call must return an object with all of the recipes that are favorited by the user so that the HTML page can dynamically create the favorites page and return all recipes uploaded by a specific user id.