Sample State
gregwaite edited this page Jan 22, 2019
·
4 revisions
{
entities: {
spots: {
1: {
id: 1,
spot_type: "Full House",
title: "The Cher Domain",
description: "A big beautiful house that I, Cher, do main",
amenities: [:shower, :bathroom],
price: 300000,
location: "23 West Elmwood Dr., Santa Monica, CA 11111",
ownerId: 1,
photos: [2,4,5,7],
reviews: [23,45,67,99],
},
2: {
id: 1,
spot_type: "Half House",
title: "The Half Cher Domain",
description: "A big beautiful house that I, Cher, half do main",
amenities: [:half-shower, :half-bathroom],
price: 150000
location: "11.5 West Elmwood Dr., Santa Monica, CA 11111"
owner_id: 1,
photos: [2,4],
reviews: [24,46],
},
users: {
1: {
id: 1,
username: "cher_lover_23",
spots: [1,3,4],
bookings: [1,4],
reviews: [8,9],
},
2: {
id: 2,
username: "cher_lover_45",
spots: [3,4],
bookings: [1,4],
reviews: [8]
}
3: {
id: 3,
username: "cher_lover_32",
spots: [1],
bookings: [1],
reviews: []
}
}
bookings: {
11: {
id: 11,
status: "pending review",
startDate: 2020-01-01,
endDate: 2021-01-02,
ownerId: 1,
guestId: 3,
spotId: 1,
},
12: {
id: 12,
status: "approved",
startDate: 2020-01-01,
endDate: 2021-01-02,
ownerId: 1,
guestId: 4,
spotId: 1,
},
},
reviews: {
1: {
id: 1,
userId: 1,
spotId: 1,
},
2: {
id: 2,
userId: 2,
spotId: 3,
},
}
photos: {
1: {
id: 1,
imageUrl: "https://www.google.com/imgres?imgurl=http://www.gstatic.com/tv/thumb/persons/314/314_v9_bc.jpg&imgrefurl=http://google.com/search?tbm%3Disch%26q%3DCher%2BBono&h=1440&w=1080&tbnid=t4rEn-cfhjYTPM:&q=cher&tbnh=186&tbnw=139&usg=AI4_-kQkMg9AdfBpeuBRB0xnd-qwHSLWog&vet=1&docid=M9lUtR_p9QCMhM&itg=1&sa=X&ved=2ahUKEwi1xNbL1vPfAhVEZN8KHaW9B_UQ_B0wJ3oECAUQBg",
title: "beauty personified",
description: "This is what beautiful looks like if you're not a big dummy",
spotId: 1,
},
25: {
id: 25,
imageUrl: "https://images.tmz.com/2018/09/27/0927-cher-house-outside-x17-3.jpg",
title: "A gorgeous home, honey",
description: "A big home for big hair",
spotId: 1,
}
}
},
ui: {
loading: true/false
},
errors: {
login: ["Incorrect username/password combination"],
spotCreation: ["You must be Cher to create a spot"],
bookingRequest: ["Start date cannot be after end date", "This spot is already reserved, honey"],
reviewCreation: ["Gotta give a rating, honey"]
},
session: { currentUserId: 1 }
}