Skip to content

Commit

Permalink
Refactors dryRun option (#1354)
Browse files Browse the repository at this point in the history
- set dryRun to false by default
- adds debug option to toggle dryRun
  • Loading branch information
Hornebom authored May 10, 2023
1 parent 74e070e commit 9f45ce1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions centrifuge-app/src/components/DebugFlags/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type Key =
| 'editPoolConfig'
| 'poolReporting'
| 'editPoolVisibility'
| 'dryRunVerifyBusiness'

export const flagsConfig: Record<Key, DebugFlagConfig> = {
address: {
Expand Down Expand Up @@ -73,4 +74,9 @@ export const flagsConfig: Record<Key, DebugFlagConfig> = {
default: false,
alwaysShow: true,
},
dryRunVerifyBusiness: {
type: 'checkbox',
default: false,
alwaysShow: true,
},
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useMutation } from 'react-query'
import { useLocation } from 'react-router-dom'
import { useDebugFlags } from '../../../components/DebugFlags'
import { useOnboardingAuth } from '../../../components/OnboardingAuthProvider'
import { useOnboarding } from '../../../components/OnboardingProvider'

Expand All @@ -16,6 +17,7 @@ export const useVerifyBusiness = () => {
const { authToken } = useOnboardingAuth()
const { refetchOnboardingUser, nextStep } = useOnboarding()
const { search } = useLocation()
const { dryRunVerifyBusiness } = useDebugFlags()

const poolId = new URLSearchParams(search).get('poolId')
const trancheId = new URLSearchParams(search).get('trancheId')
Expand All @@ -32,7 +34,7 @@ export const useVerifyBusiness = () => {
values.jurisdictionCode === 'us' || values.jurisdictionCode === 'ca'
? `${values.jurisdictionCode}_${values.regionCode}`
: values.jurisdictionCode,
dryRun: true, // TODO: set this as debug flag option
dryRun: dryRunVerifyBusiness,
manualReview: values?.manualReview ?? false,
...(values?.manualReview && poolId && trancheId && { poolId, trancheId }),
}),
Expand Down

0 comments on commit 9f45ce1

Please sign in to comment.