Skip to content

Commit

Permalink
Applied changes to newly added query hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Nov 3, 2023
1 parent bd91487 commit 7207606
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions frontend/src/modules/Rft/queryHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const CACHE_TIME = 60 * 1000;

export function useRftWellList(
caseUuid: string | undefined,
ensembleName: string | undefined,
ensembleName: string | undefined
): UseQueryResult<RftInfo_api[]> {
return useQuery({
queryKey: ["getRftWellList", caseUuid, ensembleName],
queryFn: () => apiService.rft.getRftInfo(caseUuid ?? "", ensembleName ?? ""),
staleTime: STALE_TIME,
cacheTime: CACHE_TIME,
gcTime: CACHE_TIME,
enabled: caseUuid && ensembleName ? true : false,
});
}
Expand All @@ -24,14 +24,29 @@ export function useRftRealizationData(
wellName: string | undefined,
responseName: string | undefined,
timePoints: number[] | undefined,
realizationNums: number[] | null | undefined,
realizationNums: number[] | null | undefined
): UseQueryResult<RftRealizationData_api[]> {
return useQuery({
queryKey: ["getRftRealizationData", caseUuid, ensembleName, wellName, responseName, timePoints, realizationNums],
queryFn: () => apiService.rft.getRealizationData(caseUuid ?? "", ensembleName ?? "", wellName ?? "", responseName ?? "", timePoints ?? undefined, realizationNums ?? undefined),
queryKey: [
"getRftRealizationData",
caseUuid,
ensembleName,
wellName,
responseName,
timePoints,
realizationNums,
],
queryFn: () =>
apiService.rft.getRealizationData(
caseUuid ?? "",
ensembleName ?? "",
wellName ?? "",
responseName ?? "",
timePoints ?? undefined,
realizationNums ?? undefined
),
staleTime: STALE_TIME,
cacheTime: CACHE_TIME,
gcTime: CACHE_TIME,
enabled: caseUuid && ensembleName && wellName && responseName ? true : false,
});
}

0 comments on commit 7207606

Please sign in to comment.