From 4491c71201087949aa2bb8bc8e19e9549ae35d16 Mon Sep 17 00:00:00 2001 From: Carissa Knipe Date: Mon, 8 Jul 2024 10:29:38 -0700 Subject: [PATCH] refactor: Move SoilIdData type to client-shared from mobile-client (part 1) --- src/soilId/soilIdHooks.ts | 10 ++-------- src/soilId/soilIdTypes.ts | 2 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/soilId/soilIdHooks.ts b/src/soilId/soilIdHooks.ts index 5a62bb69..83983968 100644 --- a/src/soilId/soilIdHooks.ts +++ b/src/soilId/soilIdHooks.ts @@ -24,9 +24,8 @@ import { fetchDataBasedSoilMatches, fetchLocationBasedSoilMatches, soilDataToIdInput, + SoilIdData, soilIdKey, - SoilIdResults, - SoilIdStatus, } from 'terraso-client-shared/soilId/soilIdSlice'; import type { SharedDispatch } from 'terraso-client-shared/store/store'; import { Coords } from 'terraso-client-shared/types'; @@ -36,12 +35,7 @@ import { Coords } from 'terraso-client-shared/types'; * If multiple components are passing different inputs to this hook simultaneously, it * will not function correctly. */ -export const useSoilIdData = ( - coords: Coords, - siteId?: string, -): SoilIdResults & { - status: SoilIdStatus; -} => { +export const useSoilIdData = (coords: Coords, siteId?: string): SoilIdData => { const dispatch = useDispatch(); /* We only need to select soil data for data-based matches. */ diff --git a/src/soilId/soilIdTypes.ts b/src/soilId/soilIdTypes.ts index 3aabbadb..338f1123 100644 --- a/src/soilId/soilIdTypes.ts +++ b/src/soilId/soilIdTypes.ts @@ -187,3 +187,5 @@ export type SoilIdResults = { locationBasedMatches: LocationBasedSoilMatch[]; dataBasedMatches: DataBasedSoilMatch[]; }; + +export type SoilIdData = SoilIdResults & { status: SoilIdStatus };