Skip to content

Sample State

vh71886 edited this page Jun 13, 2022 · 4 revisions
{
  entities: {
    hotels: {
      1: {
        id: 1,
        name: "four seasons",
        rooms: 11,
      },
      2: {
        id: 2,
        name: "hyatt nyc",
        rooms: 38,
      },
      3: {
        id: 3,
        name: "mint",
        rooms: 25,
      }
    },
    users: {
      11: {
        id: 11,
        username: "john smith",       
      },
      25: {
        id: 25,
        username: "jane tarzan",
      }
    },
    reservations: {
        10: {
           id: 10,
           hotelId: 30,
           roomId: 10,
        }
    },
    reviews: {
        1: {
           id: 1,
           userId: 3,
           hotelId: 1,
        }
    }
    favorites: {
        1: {
           id: 1, 
           userId: 2,
           hotelId: 1
        }
    }
  },
  ui: {
    loading: true/false,
    modal: true/false
  },
  errors: {
    login: ["Incorrect username/password combination"],
    reservationForm: ["Payment cannot be blank"],
  },
  session: { currentUserId: 25 }
}

Clone this wiki locally