Router done
This commit is contained in:
10
web/index.js
10
web/index.js
@@ -13,8 +13,12 @@ const getInitialState = (url) => {
|
||||
|
||||
for(const param of params) {
|
||||
const [key, value] = param.split("=");
|
||||
console.log('analyzing param ', key, value);
|
||||
if (key === "rooms" && value !== '') {
|
||||
|
||||
console.log("IT's ROOMS");
|
||||
value.split(",").forEach(k => {
|
||||
console.log("IT's ROOMS", k);
|
||||
initialState.rooms[parseInt(k)] = true;
|
||||
});
|
||||
}
|
||||
@@ -30,16 +34,20 @@ const getInitialState = (url) => {
|
||||
}
|
||||
|
||||
if (key === "bounds") {
|
||||
// TODO: save bounds
|
||||
initialState.bounds = value;
|
||||
}
|
||||
|
||||
if (key === "listingId") {
|
||||
initialState.listingId = value;
|
||||
}
|
||||
|
||||
if (key === "zoom") {
|
||||
initialState.zoom = parseInt(value);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('initial state dump', initialState);
|
||||
console.log('initial state ROOMS', initialState.rooms);
|
||||
return initialState;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user