Refactor SearchFilters, SelectedComplexCard, FloorsPage, SearchPage, and UnitPage components to use project slugs instead of titles for improved consistency; remove unused slugToComplexName utility; enhance unit type slug handling for "hq" complex.

This commit is contained in:
2026-01-26 19:24:01 +05:00
parent 47ab151843
commit 7fe2faa91a
7 changed files with 14 additions and 15 deletions
+2 -2
View File
@@ -106,7 +106,7 @@ function SearchFilters({
});
function handleSelectProject(project: Project | null) {
setProject(project?.title || projects[0].title);
setProject(project?.slug || projects[0].slug);
}
function handleSelectUnitTypes(unitTypes: string[]) {
@@ -187,7 +187,7 @@ function SearchFilters({
projects={projects}
onSelect={handleSelectProject}
defaultProject={
projects.find(({ title }) => title === project)!
projects.find(({ slug }) => slug === project)!
}
/>
</motion.div>
+1 -1
View File
@@ -21,7 +21,7 @@ function SelectedComplexCard({
queryKey: ["filters", "unitTypes", marker.title],
queryFn: () =>
api
.get(`units/filters/unitTypes?project=Rove Home ${marker.title}`)
.get(`units/filters/unitTypes?project=${marker.name}`)
.json<string[]>(),
});