Skip to content

Commit

Permalink
actually correct typing now
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Nov 22, 2024
1 parent a8bc146 commit ad348f3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions api-client/src/runs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export interface UpdateErrorRecoveryPolicyRequest {
data: ErrorRecoveryPolicy
}

export type UpdateErrorRecoveryPolicyResponse = Record<string, never>
export type ErrorRecoveryPolicyResponse = UpdateErrorRecoveryPolicyRequest

/**
Expand Down
7 changes: 5 additions & 2 deletions app/src/resources/runs/useUpdateRecoveryPolicyWithStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -26,7 +29,7 @@ export function useUpdateRecoveryPolicyWithStrategy(
): (
newPolicy: UpdateErrorRecoveryPolicyWithStrategy['newPolicy'],
strategy: UpdateErrorRecoveryPolicyWithStrategy['strategy']
) => Promise<ErrorRecoveryPolicyResponse> {
) => Promise<UpdateErrorRecoveryPolicyResponse> {
const host = useHost()

const {
Expand Down
10 changes: 5 additions & 5 deletions react-api-client/src/runs/useUpdateErrorRecoveryPolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
>
Expand All @@ -41,7 +41,7 @@ export function useUpdateErrorRecoveryPolicy(
const host = useHost()

const mutation = useMutation<
ErrorRecoveryPolicyResponse,
UpdateErrorRecoveryPolicyResponse,
AxiosError,
RecoveryPolicyRulesParams
>(
Expand Down

0 comments on commit ad348f3

Please sign in to comment.