Skip to content

Sample State

chen445 edited this page May 27, 2021 · 3 revisions
{
  entities: {
       users: {
            1: {
                id: 1,
                first_name: "Mikey",
                last_name: "Mouse",
                email: "mikey@gmail.com",
            },
            2: {
                id: 2,
                first_name: "Bob",
                last_name: "Rich",
                email: "rich@gmail.com",
            }
        },
        products: {
            1: {
                id: 1,
                product_name: "Oreo 3 Packs",
                price: 9.00,
                seller_id: 1,
                product_description: "Three family size packs of OREO Double Stuf Chocolate Sandwich Cookies.",
                imgUrl: "https://images-na.ssl-images-amazon.com/images/I/818l61dgR%2BS._SL1500_.jpg",
            },
            2: {
                id: 2,
                product_name: "Horizon Organic Whole Milk",
                price: 12.00,
                seller_id: 1,
                product_description: "Organic milk from California.",
                imgUrl: "https://images-na.ssl-images-amazon.com/images/I/81hffHqMggL._SL1500_.jpg",
            }
        },
        CartItem: {
            1: {
                id: 1,
                user_id: 2,
                product_id: 1,
                quantities: 2
            }
            2: {
                id: 2,
                user_id: 2,
                product_id: 2,
                quantities: 1
            }
        },
        Review: {
            1: {
                id: 1,
                reviewer_id: 2,
                product_id: 1,
                rating: 4.5,
                title: "Delicious"
                body: "The taste was so good. I highly recommend it.",
            }
            2: {
                id: 2,
                reviewer_id: 3,
                product_id: 2,
                rating: 4,
                title: "Pretty good!",
                body: "Good milk with a reasonable price.",
            }
        },
    },
    ui: {
        modal: true/false
    },
    errors: {
        Login: ["Please Sign in or Sign up"],
        Cart: ["Your Cart is empty"],
        Review: ["Title or Body cannot be empty"],
    },
    session: { currentUserId: 1}
}

Clone this wiki locally