Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors dryRun option #1354

Merged
merged 2 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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