mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-05-19 13:56:58 -04:00
type total_bounds
This commit is contained in:
9
src/api/types.d.ts
vendored
9
src/api/types.d.ts
vendored
@@ -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";
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user