homeflowjs 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -147,10 +147,10 @@ export const loadNext = () => (dispatch, getState) => {
|
|
147
147
|
dispatch(setLoading({ properties: true }));
|
148
148
|
// set page on search to page + 1
|
149
149
|
let newProperties = [...getState().properties.properties];
|
150
|
-
const
|
151
|
-
|
150
|
+
const nextPageSearch = { ...getState().search.initialSearch };
|
151
|
+
nextPageSearch.page = nextPageSearch.page ? nextPageSearch.page + 1 : 2;
|
152
152
|
// conduct search ljson
|
153
|
-
return fetch(`/search.ljson?${buildQueryString(
|
153
|
+
return fetch(`/search.ljson?${buildQueryString(nextPageSearch)}`)
|
154
154
|
.then((response) => response.json())
|
155
155
|
.then((json) => {
|
156
156
|
if (json.properties) {
|
@@ -163,10 +163,10 @@ export const loadNext = () => (dispatch, getState) => {
|
|
163
163
|
);
|
164
164
|
// add the page number to each new property for dividing properties into per-page divs
|
165
165
|
const addedProperties = json.properties.map((property) => (
|
166
|
-
{ ...property, resultPage:
|
166
|
+
{ ...property, resultPage: nextPageSearch.page }
|
167
167
|
));
|
168
168
|
newProperties = [...newProperties, ...addedProperties];
|
169
|
-
dispatch(setSearch(
|
169
|
+
dispatch(setSearch(nextPageSearch));
|
170
170
|
dispatch(setProperties(newProperties));
|
171
171
|
dispatch(setPagination(json.pagination));
|
172
172
|
dispatch(setLoading({ properties: false }));
|