Skip to content

Sample State

MonicaKornis edited this page Dec 21, 2017 · 6 revisions

const stateShape = { entities: { users: { 1: { email: "xyz@gmail.com", liked_recipes_ids: [11,44], authored_recipes_ids: [22] }, 2: { email: "myemail@gmail.com", liked_recipes_ids: [2,3,5], authored_recipes_ids: [8] }, 3: { email: "dankmemes@gmail.com", liked_recipes_ids: [1,2,8], authored_recipes_ids: [3,6,2] } },

recipes: {
  1: {
    title: "Blueberry Pie",
    body: "xyx",
    author_id: 1,
    comment_ids: [23,12,1],
    image_url: '/assets/120.png',
    likes: 6
  },
  2: {
    title: "Shakshuka",
    body: "xyx",
    author_id: 2,
    comment_ids: [2,3,4],
    image_url: '/assets/140.png',
    likes: 6
  },
  3: {
    title: "Thai Green Curry With Shrimp",
    body: "xyx",
    author_id: 3,
    comment_ids: [1,2,3],
    image_url: '/assets/114.png',
    likes: 6
  }
},

comments: {
  1: {
    author_id: 1,
    body: "I love this recipe!",
    likes: 2
  },
  2: {
    author_id: 1,
    body: "Horrendous...",
    likes: 1
  },
  3: {
    author_id: 1,
    body: "I love 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