diff --git a/source/frontend/src/features/leases/add/AddLeaseForm.tsx b/source/frontend/src/features/leases/add/AddLeaseForm.tsx index ec5ab0408d..6930a2a251 100644 --- a/source/frontend/src/features/leases/add/AddLeaseForm.tsx +++ b/source/frontend/src/features/leases/add/AddLeaseForm.tsx @@ -28,15 +28,16 @@ const AddLeaseForm: React.FunctionComponent { const defaultFormLease = getDefaultFormLease(); - const apiFormLease = LeaseFormModel.toApi(defaultFormLease); + const { getByType } = useLookupCodeHelpers(); const consultationTypes = getByType(API.CONSULTATION_TYPES); - apiFormLease.consultations = getConsultations(apiFormLease, consultationTypes); if (propertyInfo) { defaultFormLease.properties = []; defaultFormLease.properties.push(FormLeaseProperty.fromMapProperty(propertyInfo)); defaultFormLease.regionId = propertyInfo.region ? propertyInfo.region.toString() : ''; } + const apiFormLease = LeaseFormModel.toApi(defaultFormLease); + apiFormLease.consultations = getConsultations(apiFormLease, consultationTypes); const handleSubmit = async ( values: LeaseFormModel,