From ad348f36ad51950581f3075bd415d40afd9047a3 Mon Sep 17 00:00:00 2001 From: Jamey Huffnagle Date: Fri, 22 Nov 2024 11:58:01 -0500 Subject: [PATCH] actually correct typing now --- api-client/src/runs/types.ts | 1 + .../runs/useUpdateRecoveryPolicyWithStrategy.ts | 7 +++++-- .../src/runs/useUpdateErrorRecoveryPolicy.ts | 10 +++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/api-client/src/runs/types.ts b/api-client/src/runs/types.ts index 2692fff5987..e41626b6448 100644 --- a/api-client/src/runs/types.ts +++ b/api-client/src/runs/types.ts @@ -203,6 +203,7 @@ export interface UpdateErrorRecoveryPolicyRequest { data: ErrorRecoveryPolicy } +export type UpdateErrorRecoveryPolicyResponse = Record export type ErrorRecoveryPolicyResponse = UpdateErrorRecoveryPolicyRequest /** diff --git a/app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts b/app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts index 7720066c74e..22060b053ca 100644 --- a/app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts +++ b/app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts @@ -2,7 +2,10 @@ import { useHost, useUpdateErrorRecoveryPolicy, } from '@opentrons/react-api-client' -import { getErrorRecoveryPolicy } from '@opentrons/api-client' +import { + getErrorRecoveryPolicy, + UpdateErrorRecoveryPolicyResponse, +} from '@opentrons/api-client' import type { HostConfig, @@ -26,7 +29,7 @@ export function useUpdateRecoveryPolicyWithStrategy( ): ( newPolicy: UpdateErrorRecoveryPolicyWithStrategy['newPolicy'], strategy: UpdateErrorRecoveryPolicyWithStrategy['strategy'] -) => Promise { +) => Promise { const host = useHost() const { diff --git a/react-api-client/src/runs/useUpdateErrorRecoveryPolicy.ts b/react-api-client/src/runs/useUpdateErrorRecoveryPolicy.ts index 10ea2a2cd22..7e09abc6160 100644 --- a/react-api-client/src/runs/useUpdateErrorRecoveryPolicy.ts +++ b/react-api-client/src/runs/useUpdateErrorRecoveryPolicy.ts @@ -12,24 +12,24 @@ import type { import type { AxiosError } from 'axios' import type { RecoveryPolicyRulesParams, - ErrorRecoveryPolicyResponse, + UpdateErrorRecoveryPolicyResponse, HostConfig, } from '@opentrons/api-client' export type UseErrorRecoveryPolicyResponse = UseMutationResult< - ErrorRecoveryPolicyResponse, + UpdateErrorRecoveryPolicyResponse, AxiosError, RecoveryPolicyRulesParams > & { updateErrorRecoveryPolicy: UseMutateFunction< - ErrorRecoveryPolicyResponse, + UpdateErrorRecoveryPolicyResponse, AxiosError, RecoveryPolicyRulesParams > } export type UseUpdateErrorRecoveryPolicyOptions = UseMutationOptions< - ErrorRecoveryPolicyResponse, + UpdateErrorRecoveryPolicyResponse, AxiosError, RecoveryPolicyRulesParams > @@ -41,7 +41,7 @@ export function useUpdateErrorRecoveryPolicy( const host = useHost() const mutation = useMutation< - ErrorRecoveryPolicyResponse, + UpdateErrorRecoveryPolicyResponse, AxiosError, RecoveryPolicyRulesParams >(