trying out
This commit is contained in:
@@ -7,7 +7,8 @@ export const loadProperties = ({
|
||||
minSize = '',
|
||||
maxSize = '',
|
||||
rooms = {},
|
||||
category = {}
|
||||
category = {},
|
||||
lastRecordId
|
||||
}) => {
|
||||
const allRooms = Object
|
||||
.keys(rooms)
|
||||
@@ -21,7 +22,13 @@ export const loadProperties = ({
|
||||
|
||||
// TODO: handle errors
|
||||
//return fetch(process.env.API_URL + '/api/search', {
|
||||
return fetch(`http://localhost:3001/api/search?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}`
|
||||
|
||||
if (lastRecordId) {
|
||||
url += `&lastRecordId=${lastRecordId}`;
|
||||
}
|
||||
|
||||
return fetch(url, {
|
||||
//credentials: 'include'
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user