diff --git a/src/pages/FavouritesPage.tsx b/src/pages/FavouritesPage.tsx
index d179af5..94be009 100644
--- a/src/pages/FavouritesPage.tsx
+++ b/src/pages/FavouritesPage.tsx
@@ -56,6 +56,18 @@ function FavoritesPage() {
.filter(
(unit) => !selectedProject || unit.project === selectedProject
)
+ .sort((a, b) => {
+ if (sort === "Sort by ascending price") {
+ return a.salesPrice - b.salesPrice;
+ } else if (sort === "Sort by descending price") {
+ return b.salesPrice - a.salesPrice;
+ } else if (sort === "Sort by ascending area") {
+ return a.squareFt - b.squareFt;
+ } else if (sort === "Sort by descending area") {
+ return b.squareFt - a.squareFt;
+ }
+ return 0;
+ })
.map((unit) => (
))}
diff --git a/src/pages/SearchPage.tsx b/src/pages/SearchPage.tsx
index 8d55eb9..5e9947c 100644
--- a/src/pages/SearchPage.tsx
+++ b/src/pages/SearchPage.tsx
@@ -68,15 +68,21 @@ function SearchPage() {
view ? `&view=${view}` : ""
}${
debouncedCost.length > 0
- ? `&cost=${debouncedCost.map(Math.round).join()}`
+ ? `&cost=${Math.floor(debouncedCost[0])},${Math.ceil(
+ debouncedCost[1]
+ )}`
: ""
}${
debouncedFloor.length > 0
- ? `&floor=${debouncedFloor.map(Math.round).join()}`
+ ? `&floor=${Math.floor(debouncedFloor[0])},${Math.ceil(
+ debouncedFloor[1]
+ )}`
: ""
}${
debouncedArea.length > 0
- ? `&area=${debouncedArea.map(Math.round).join()}`
+ ? `&area=${Math.floor(debouncedArea[0])},${Math.ceil(
+ debouncedArea[1]
+ )}`
: ""
}${sort ? `&order=${SORT_OPTIONS[sort].split(" ").join()}` : ""}`
)