diff --git a/api-client/src/runs/types.ts b/api-client/src/runs/types.ts index 2692fff5987..80583c5863f 100644 --- a/api-client/src/runs/types.ts +++ b/api-client/src/runs/types.ts @@ -203,7 +203,8 @@ export interface UpdateErrorRecoveryPolicyRequest { data: ErrorRecoveryPolicy } -export type ErrorRecoveryPolicyResponse = UpdateErrorRecoveryPolicyRequest +export type UpdateErrorRecoveryPolicyResponse = Record +export type ErrorRecoveryPolicyResponse = ErrorRecoveryPolicy /** * Current Run State Data diff --git a/app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts b/app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts index 7720066c74e..7e47a86d76f 100644 --- a/app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts +++ b/app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts @@ -6,8 +6,8 @@ import { getErrorRecoveryPolicy } from '@opentrons/api-client' import type { HostConfig, - ErrorRecoveryPolicyResponse, RecoveryPolicyRulesParams, + UpdateErrorRecoveryPolicyResponse, } from '@opentrons/api-client' /** @@ -26,7 +26,7 @@ export function useUpdateRecoveryPolicyWithStrategy( ): ( newPolicy: UpdateErrorRecoveryPolicyWithStrategy['newPolicy'], strategy: UpdateErrorRecoveryPolicyWithStrategy['strategy'] -) => Promise { +) => Promise { const host = useHost() const { @@ -38,7 +38,7 @@ export function useUpdateRecoveryPolicyWithStrategy( strategy: UpdateErrorRecoveryPolicyWithStrategy['strategy'] ) => getErrorRecoveryPolicy(host as HostConfig, runId).then(res => { - const existingPolicyRules = res.data.data.policyRules.map(rule => ({ + const existingPolicyRules = res.data.policyRules.map(rule => ({ commandType: rule.matchCriteria.command.commandType, errorType: rule.matchCriteria.command.error.errorType, ifMatch: rule.ifMatch, 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 >(