type total_bounds

This commit is contained in:
sepeterson
2026-05-14 16:05:12 -05:00
parent 7319c4a9ee
commit dfb2655925
2 changed files with 12 additions and 2 deletions

9
src/api/types.d.ts vendored
View File

@@ -193,9 +193,16 @@ export interface ApiSuggestion {
combined_score: number;
}
export interface ApiTotalBounds {
swlat: number;
swlng: number;
nelat: number;
nelng: number;
}
export interface ApiObservationsSearchResponse extends ApiResponse {
results: ApiObservation[];
total_bounds?: object;
total_bounds?: ApiTotalBounds;
}
export const ORDER_BY_CREATED_AT = "created_at";

View File

@@ -4,6 +4,7 @@ import type {
ApiObservation,
ApiObservationsSearchParams,
ApiObservationsSearchResponse,
ApiTotalBounds,
} from "api/types";
import flatten from "lodash/flatten";
import { useCallback, useMemo } from "react";
@@ -31,7 +32,7 @@ interface UseInfiniteExploreScrollReturn {
handlePullToRefresh: ( ) => Promise<void>;
observations: ApiObservation[];
status: string;
totalBounds: object | undefined;
totalBounds: ApiTotalBounds | undefined;
totalResults: number | null | undefined;
}
@@ -43,7 +44,9 @@ const useInfiniteExploreScroll = (
const baseParams = useMemo( () => ( {
...newInputParams,
fields: {
// Same fields as MyObservations advanced list mode
...Observation.ADVANCED_MODE_LIST_FIELDS,
// Included for "exclude by current user" in explore filters
user: {
id: true,
uuid: true,