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:
@@ -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>
|
||||
|
||||
@@ -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[]>(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user