Skip to content

Sample State

tjshiu edited this page Apr 6, 2018 · 18 revisions

Sample State

{
  entities: {
   products: {
     1: {
       id: 1,
       productName: "Salmon Dinner"
       userId: 13,
       overview: "Light, hearty, and delicious fresh caught Salmon",
       description: "Enjoy a evening meal of salmon cooked fresh for you at your own home. We bring all the ingredients and help make something that you and your family will enjoy.",
       cost: 50.00,
       imageUrl: "salmon.com/img",
       reviewIds: []
    },
     2: {
       id: 2,
       productName: "Brunch Special for two",
       userId: 13,
       overview: "Quirky brunch special for two",
       description: "We come in and create a meal that you and someone special will enjoy with a few surprises.",
       cost: 30.00,
       imageUrl: "brunch.com/img",
       reviewIds: [56, 57]
    }
   },
   images {
     23: {
       id: 23,
       productId: 1,
       imageUrl: "salmondinnner.com"
     }
     24: {
       id: 24,
       productId: 2,
       imageUrl: "brunchspecial.com"
     }
   },
   reviews {
     56: {
       id: 56,
       userId: 12,
       productId: 1,
       rating: 5,
       comment: "Where are my dragons?"
     }
     57: {
       id: 57,
       userId: 12,
       productId: 2,
       rating: 1,
       comment: "White Walkers"
     }
   },
   users: {
     12: {
       id: 12,
       username: "JonSnow",
       imageUrl: "ironking.com/img"
    },
    13: {
       id: 13,
       username: "Dany",
       imageUrl: "ironking.com/dragons"
    }
   },
   shoppingCartItems: {
     987: {
        id: 987,
        productId: 1,
        quantity: 1
     },
     567: {
        id: 567,
        productId: 2,
        quantity: 2
     }
   }
  },
  ui: {
    loading: true/false
  }
  errors: {
    signIn: ["Incorrect username/password combination"],
    register: ["Username cannot be blank", "Password must be a minimum length of six", "Email cannot be blank"],
    productForm: ["Cannot be blank!"]
  },
  session: {
    currentUser: {
      id: 13,
      username: "Dany",
      imageUrl: "ironking.com/dragons",
      shoppingCartItemIds: [987,567]
    }
  }
}



Clone this wiki locally