top of page
Blog: Blog2
Search

Adding Favourites Recipes into Database

  • Writer: Dominic Ng
    Dominic Ng
  • Nov 25, 2018
  • 1 min read

Updated: Feb 6, 2019


Hello there! As more and more assignments are piling up, time left for the development of Gastronome are becoming lesser and amount of sleep is decreasing! This week, I worked on the feature whereby users are able to select their desired recipes and favourite them. After favouriting a recipe, Firebase will store the data of the recipe details under the User ID in the Favourites node. The data structure of the Favourites has been mentioned in my first blog for Gastronome and it can be seen in the screenshot below.

The data structure is as followed, the Favourite node which child are every User ID of users who have at least 1 favourited recipe. And in each User ID, it contains the user email as well as the Recipe object, which contains all the details for every class. As this function was implemented in the same activity as the RecipeInfoActivity which already contains the Recipe object, I did not face much problem when adding it into Firebase.

After completing this task where users are now able to favourite their desired recipe, I immediately started working on other assignments to prevent me from unable to complete other module’s assignments. As the database now contains the favourited recipes as well as which users is associated to it, next week I will be working on the Favourites Page where it will display all the recipes that were favourited by the users. I will be documenting my progress on the displaying of favourited recipes in my next blog so see you there!




ree

 
 
 

Comments


©2019 by Gastronome.

bottom of page