diff --git a/apps/provider-console/src/components/become-provider/ProviderPricing.tsx b/apps/provider-console/src/components/become-provider/ProviderPricing.tsx index 354ffbc8c..370c7052a 100644 --- a/apps/provider-console/src/components/become-provider/ProviderPricing.tsx +++ b/apps/provider-console/src/components/become-provider/ProviderPricing.tsx @@ -55,6 +55,7 @@ const providerPricingSchema = z.object({ type ProviderPricingValues = z.infer; export const ProviderPricing: React.FC = ({ onComplete, editMode = false, existingPricing, disabled = false, providerDetails }) => { + console.log(existingPricing) const [providerProcess, setProviderProcess] = useAtom(providerProcessStore.providerProcessAtom); const { activeControlMachine } = useControlMachine(); const [showSuccess, setShowSuccess] = React.useState(false); @@ -136,6 +137,12 @@ export const ProviderPricing: React.FC = ({ onComplete, ed } }); + useEffect(() => { + if (editMode && existingPricing) { + form.reset(existingPricing); + } + }, [editMode, existingPricing, form]); + const watchValues = form.watch(); const calculateEstimatedEarnings = useCallback(