Skip to content

Sample State

MonicaKornis edited this page Dec 21, 2017 · 6 revisions
  entities: {
    users: {
      1: {
        email: "xyz@gmail.com",
        likedRecipesIds: [11,44],
        authoredRecipeIds: [22]
      },
      2: {
        email: "myemail@gmail.com",
        likedRecipesIds: [2,3,5],
        authoredRecipeIds: [8]
      },
      3: {
        email: "dankmemes@gmail.com",
        likedRecipesIds: [1,2,8],
        authoredRecipeIds: [3,6,2]
      }
    },

    recipes: {
      1: {
        title: "Blueberry Pie",
        ingredientList: ["blueberries"],
        body: "xyx",
        authorId: 1,
        commentIds: [23,12,1],
        imageUrl: '/assets/120.png',
        likes: 6
      },
      2: {
        title: "Shakshuka",
        ingredientList: ["tomatoes"],
        body: "xyx",
        authorId: 2,
        commentIds: [2,3,4],
        imageUrl: '/assets/140.png',
        likes: 6
      },
      3: {
        title: "Thai Green Curry With Shrimp",
        ingredientList: ["shrimp","rice noodles"],
        body: "xyx",
        authorId: 3,
        commentIds: [1,2,3],
        imageUrl: '/assets/114.png',
        likes: 6
      }
    },
    comments: {
      1: {
        authorId: 1,
        body: "I love this recipe!",
        likes: 2
      },
      2: {
        authorId: 1,
        body: "Horrendous...",
        likes: 1
      },
      3: {
        authorId: 1,
        body: "I love eating flavorless mush!",
        likes: 22
      }
    },
    recipe_folders: {
     1: {
       title: 'Vegan Cakes',
       description: 'crowd-pleasing vegan cake recipes',
       recipeIds: [34,56,70,22]
     },
   },
   errors: {
     login: ["Incorrect username/password combination"],
     recipeForm: ["Recipe title/body cannot be blank"],
     },
   session: {
     id: 57,
     email: "xyz@gmail.com",
    }
  }
};

Clone this wiki locally