Skip to content

Commit

Permalink
fix: adjusting query enable
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaseta committed Dec 5, 2024
1 parent b2de04b commit ca60c1e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type OwnershipStepProps = {
/*
Component
*/
const OwnershipStep = ({ isReview }: OwnershipStepProps) => {
const OwnershipStep = ({ isReview = false }: OwnershipStepProps) => {
const {
allStepData: { ownershipStep: state },
setStepData,
Expand Down Expand Up @@ -110,11 +110,11 @@ const OwnershipStep = ({ isReview }: OwnershipStepProps) => {
cacheTime: THREE_HALF_HOURS
});

const getSeedlotBySeedlotNumberQuery = useQuery(
['get-seedlot-by-seedlotNumber', seedlotNumber],
() => getSeedlotFromOracleDbBySeedlotNumber(seedlotNumber ?? ''),
{ enabled: !!seedlotNumber && isReview }
);
const getSeedlotBySeedlotNumberQuery = useQuery({
queryKey: ['get-seedlot-by-seedlotNumber', seedlotNumber],
queryFn: () => getSeedlotFromOracleDbBySeedlotNumber(seedlotNumber ?? ''),
enabled: isReview && !!seedlotNumber
});

// Set default method of payment for the first owner.
useEffect(() => {
Expand Down

0 comments on commit ca60c1e

Please sign in to comment.