diff --git a/app/hooks/cost-surface/index.ts b/app/hooks/cost-surface/index.ts index 7fac58c35b..ceaffa034f 100644 --- a/app/hooks/cost-surface/index.ts +++ b/app/hooks/cost-surface/index.ts @@ -24,7 +24,10 @@ export function useProjectCostSurfaces( headers: { Authorization: `Bearer ${session.accessToken}`, }, - params, + params: { + disablePagination: true, + ...params, + }, }).then(({ data }) => data?.data), enabled: Boolean(pid), ...queryOptions, diff --git a/app/hooks/features/index.ts b/app/hooks/features/index.ts index a91829a9b5..456c7a6dec 100644 --- a/app/hooks/features/index.ts +++ b/app/hooks/features/index.ts @@ -197,6 +197,7 @@ export function useAllFeatures( ...(sort && { sort, }), + disablePagination: true, }, }).then(({ data }) => data); @@ -222,6 +223,9 @@ export function useSelectedFeatures( headers: { Authorization: `Bearer ${session.accessToken}`, }, + params: { + disablePagination: true, + }, }).then(({ data }) => data); return useQuery(['selected-features', sid], fetchFeatures, { @@ -355,6 +359,9 @@ export function useTargetedFeatures( headers: { Authorization: `Bearer ${session.accessToken}`, }, + params: { + disablePagination: true, + }, }).then(({ data }) => data); return useQuery(['targeted-features', sid], fetchFeatures, { diff --git a/app/hooks/gap-analysis/index.ts b/app/hooks/gap-analysis/index.ts index 4a14dc9bc7..22c28c0783 100644 --- a/app/hooks/gap-analysis/index.ts +++ b/app/hooks/gap-analysis/index.ts @@ -65,7 +65,6 @@ export function usePreGapAnalysis(sId, options: UseFeaturesOptionsProps = {}) { Authorization: `Bearer ${session.accessToken}`, }, params: { - 'page[number]': pageParam, ...parsedFilters, ...(search && { q: search, @@ -73,6 +72,7 @@ export function usePreGapAnalysis(sId, options: UseFeaturesOptionsProps = {}) { ...(sort && { sort, }), + disablePagination: true, }, }); diff --git a/app/hooks/scenarios/index.ts b/app/hooks/scenarios/index.ts index 50afaa0ee4..8ed08797eb 100644 --- a/app/hooks/scenarios/index.ts +++ b/app/hooks/scenarios/index.ts @@ -351,7 +351,7 @@ export function useScenarios(pId, options: UseScenariosOptionsProps = {}) { }; }, {}); - const fetchScenarios = ({ pageParam = 1 }) => + const fetchScenarios = () => SCENARIOS.request({ method: 'GET', url: '/', @@ -359,7 +359,6 @@ export function useScenarios(pId, options: UseScenariosOptionsProps = {}) { Authorization: `Bearer ${session.accessToken}`, }, params: { - 'page[number]': pageParam, ...parsedFilters, ...(search && { q: search, @@ -367,6 +366,7 @@ export function useScenarios(pId, options: UseScenariosOptionsProps = {}) { ...(sort && { sort, }), + disablePagination: true, }, }); diff --git a/app/hooks/wdpa/index.ts b/app/hooks/wdpa/index.ts index 60d398115f..b29977ed7f 100644 --- a/app/hooks/wdpa/index.ts +++ b/app/hooks/wdpa/index.ts @@ -35,6 +35,7 @@ export function useWDPACategories({ ...(customAreaId && { 'filter[customAreaId]': customAreaId, }), + disablePagination: true, }, headers: { Authorization: `Bearer ${session.accessToken}`, @@ -104,6 +105,7 @@ export function useProjectWDPAs( ...(sort && { sort, }), + disablePagination: true, }, }).then(({ data }) => data.data); diff --git a/app/layout/projects/show/map/legend/hooks/index.ts b/app/layout/projects/show/map/legend/hooks/index.ts index 635efe3348..5ddb047708 100644 --- a/app/layout/projects/show/map/legend/hooks/index.ts +++ b/app/layout/projects/show/map/legend/hooks/index.ts @@ -124,7 +124,7 @@ export const useFeaturesLegend = () => { const dispatch = useAppDispatch(); const projectFeaturesQuery = useAllFeatures( pid, - { sort: 'feature_class_name' }, + { sort: 'featureClassName' }, { select: ({ data }) => ({ binaryFeatures: diff --git a/app/layout/scenarios/edit/map/legend/hooks/index.ts b/app/layout/scenarios/edit/map/legend/hooks/index.ts index 51d8063178..e050b9ba73 100644 --- a/app/layout/scenarios/edit/map/legend/hooks/index.ts +++ b/app/layout/scenarios/edit/map/legend/hooks/index.ts @@ -131,7 +131,7 @@ export const useFeaturesLegend = () => { const dispatch = useAppDispatch(); const projectFeaturesQuery = useAllFeatures( pid, - { sort: 'feature_class_name' }, + { sort: 'featureClassName' }, { select: ({ data }) => ({ binaryFeatures: