|
1 |
| -import { useSpecies } from 'data-services/hooks/species/useSpecies' |
2 |
| -import { useSpeciesDetails } from 'data-services/hooks/species/useSpeciesDetails' |
| 1 | +import { useSpeciesObserved } from 'data-services/hooks/species-observed/useSpeciesObserved' |
| 2 | +import { useSpeciesObservedDetails } from 'data-services/hooks/species-observed/useSpeciesObservedDetails' |
3 | 3 | import * as Dialog from 'design-system/components/dialog/dialog'
|
4 | 4 | import { IconType } from 'design-system/components/icon/icon'
|
5 | 5 | import { PageFooter } from 'design-system/components/page-footer/page-footer'
|
@@ -28,7 +28,7 @@ export const Species = () => {
|
28 | 28 | const { sort, setSort } = useSort({ field: 'name', order: 'asc' })
|
29 | 29 | const { pagination, setPage } = usePagination()
|
30 | 30 | const { filters } = useFilters()
|
31 |
| - const { species, total, isLoading, isFetching, error } = useSpecies({ |
| 31 | + const { species, total, isLoading, isFetching, error } = useSpeciesObserved({ |
32 | 32 | projectId,
|
33 | 33 | sort,
|
34 | 34 | pagination,
|
@@ -101,10 +101,10 @@ const SpeciesDetailsDialog = ({ id }: { id: string }) => {
|
101 | 101 | const navigate = useNavigate()
|
102 | 102 | const { projectId } = useParams()
|
103 | 103 | const { setDetailBreadcrumb } = useContext(BreadcrumbContext)
|
104 |
| - const { species, isLoading, error } = useSpeciesDetails(id, projectId) |
| 104 | + const { species, isLoading, error } = useSpeciesObservedDetails(id) |
105 | 105 |
|
106 | 106 | useEffect(() => {
|
107 |
| - setDetailBreadcrumb(species ? { title: species.name } : undefined) |
| 107 | + setDetailBreadcrumb(species ? { title: species.taxon.name } : undefined) |
108 | 108 |
|
109 | 109 | return () => {
|
110 | 110 | setDetailBreadcrumb(undefined)
|
|
0 commit comments