Skip to content

Sample State

wcorona269 edited this page Apr 25, 2022 · 8 revisions

Sample State

{
    entities: {
        users: {
            1: {
                id: 1,
                email: "[email protected]",
                username: "food_enjoyer",
            },
            2: {
                id: 2,
                email: "[email protected]",
                username: "take_the_cannolis",
            },
        },
        restaurants: {
            25: {
                id: 25,
                name: "Hearth",
                cuisines: "Italian, American, Farm-to-table",
                address: "403 E 12th St, New York, NY 10009",
                menu: "Ricotta Meatballs, Sourdough Bread",
                phone: 123-456-7890,
                priceRange: 3,
            },
            26: {
                id: 26,
                name: "Galli",
                cuisines: "Italian, Comfort Food",
                address: "45 Mercer Street, New York, NY 10013",
                menu: "Mozz Chips, Penne Vodka",
                phone: 123-456-7890,
                priceRange: 2,
            },
          
        reviews: {
            3: {
                id: 3,
                body: "My soda was flat!",
                overall_rating: 2,
                food_rating: 2,
                service_rating: 2,
                ambiance_rating: 2,
                authorId: 1,
                restId: 26,
            },
            8: {
                id: 8,
                body: "Can't wait to come back!",
                overall_rating: 5,
                food_rating: 5,
                service_rating: 4,
                ambiance_rating: 5,
                authorId: 2,
                restId: 26,
            },
        },
        reservations: {
            3: {
                id: 3,
                userId: 1,
                restId: 25,
                res_date: 2022/03/10,
                res_time: 16:00,
                party_size: 5
            },
            4: {
                id: 4,
                userId: 2,
                restId: 26,
                date: 2022/06/15,
                time: 19:45,
                party_size: 2
            },
        },
        savedRestaraunts: {
            4: {
                id: 4,
                userId: 1,
                restId: 25,
            },
            5: {
                id: 5,
                userId: 2,
                restId: 25,
            },
            6: {
                id: 6,
                userId: 2,
                restId: 26,
            }
        }
    },
    ui: {
        loading: true/false,
        modal: "signup"
    },
    session: {
        currentUserId: 2,
        savedRestaraunts: [25, 26]
    },
    errors: {
        signUp: ["Please fill out the required information"],
        login: ["Please fill out the required information"],
        reviewSubmit: ["Please fill in all fields"],
        rsvpSubmit: ["Please fill in all fields"]
    }
}

Clone this wiki locally