Basic pagination working
This commit is contained in:
@@ -8,7 +8,7 @@ export const loadProperties = ({
|
||||
maxSize = '',
|
||||
rooms = {},
|
||||
category = {},
|
||||
lastRecordId
|
||||
page = 1
|
||||
}) => {
|
||||
const allRooms = Object
|
||||
.keys(rooms)
|
||||
@@ -22,11 +22,11 @@ export const loadProperties = ({
|
||||
|
||||
// TODO: handle errors
|
||||
//return fetch(process.env.API_URL + '/api/search', {
|
||||
let url = `http://localhost:3001/api/search/listings?bounds=${bounds}&minPrice=${minPrice}&maxPrice=${maxPrice}&rooms=${allRooms}&minSize=${minSize}&maxSize=${maxSize}&category=${allCategories}`
|
||||
let url = `http://localhost:3001/api/search/listings?bounds=${bounds}&minPrice=${minPrice}&maxPrice=${maxPrice}&rooms=${allRooms}&minSize=${minSize}&maxSize=${maxSize}&category=${allCategories}&page=${page}`
|
||||
|
||||
if (lastRecordId) {
|
||||
url += `&lastRecordId=${lastRecordId}`;
|
||||
}
|
||||
//if (lastRecordId) {
|
||||
//url += `&lastRecordId=${lastRecordId}`;
|
||||
//}
|
||||
|
||||
return fetch(url, {
|
||||
//credentials: 'include'
|
||||
|
||||
Reference in New Issue
Block a user