Skip to content

Commit

Permalink
fix: adjusting ownership agency
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaseta committed Jan 6, 2025
1 parent 5a718b6 commit d3886ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ const OwnershipStep = ({ isReview = false }: OwnershipStepProps) => {
seedlotNumber
} = useContext(ClassAContext);

console.log(state);

const [accordionControls, setAccordionControls] = useState<AccordionCtrlObj>({});
const [originalSeedQty, setOriginalSeedQty] = useState<number>(0);

Expand Down
8 changes: 5 additions & 3 deletions frontend/src/views/Seedlot/ContextContainerClassA/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ export const initOwnershipState = (
defaultAgencyNumber: string,
ownersStepData: Array<SingleOwnerFormSubmitType>,
methodsOfPayment?: Array<MultiOptionsObj>,
fundingSource?: Array<MultiOptionsObj>
fundingSource?: Array<MultiOptionsObj>,
initLoaded?: boolean
): Array<SingleOwnerForm> => {
const seedlotOwners: Array<SingleOwnerForm> = ownersStepData.map((curOwner, index) => {
const ownerState = createOwnerTemplate(index, curOwner);

ownerState.ownerAgency.value = defaultAgencyNumber;
ownerState.ownerAgency.value = initLoaded ? curOwner.ownerClientNumber : defaultAgencyNumber;
ownerState.ownerCode.value = curOwner.ownerLocnCode;

if (methodsOfPayment && methodsOfPayment.length > 0) {
Expand Down Expand Up @@ -1120,7 +1121,8 @@ export const resDataToState = (
defaultAgencyNumber,
fullFormData.seedlotFormOwnershipDtoList,
methodsOfPaymentData,
fundingSourcesData
fundingSourcesData,
true
),
interimStep: initInterimState(
fullFormData.seedlotFormInterimDto.intermStrgClientNumber,
Expand Down

0 comments on commit d3886ba

Please sign in to comment.