diff --git a/src/leases/components/leaseSections/rent/OldDwellingsInHousingCompaniesPriceIndexEdit.tsx b/src/leases/components/leaseSections/rent/OldDwellingsInHousingCompaniesPriceIndexEdit.tsx index 9516b821..ba45a6c1 100644 --- a/src/leases/components/leaseSections/rent/OldDwellingsInHousingCompaniesPriceIndexEdit.tsx +++ b/src/leases/components/leaseSections/rent/OldDwellingsInHousingCompaniesPriceIndexEdit.tsx @@ -30,6 +30,7 @@ import { getReviewDays } from "@/leases/helpers"; type Props = { oldDwellingsInHousingCompaniesPriceIndex: OldDwellingsInHousingCompaniesPriceIndexProps; oldDwellingsInHousingCompaniesPriceIndexType: OldDwellingsInHousingCompaniesPriceIndexType; + typeFieldName: string; leaseAttributes: Attributes; leaseStartDate: string; isSaveClicked: boolean; @@ -53,6 +54,7 @@ class OldDwellingsInHousingCompaniesPriceIndexEdit extends PureComponent const { oldDwellingsInHousingCompaniesPriceIndex, oldDwellingsInHousingCompaniesPriceIndexType, + typeFieldName, leaseAttributes, leaseStartDate, isSaveClicked, @@ -77,7 +79,7 @@ class OldDwellingsInHousingCompaniesPriceIndexEdit extends PureComponent leaseAttributes, LeaseRentsFieldPaths.OLD_DWELLINGS_IN_HOUSING_COMPANIES_PRICE_INDEX_TYPE, )} - name="old_dwellings_in_housing_companies_price_index_type" + name={typeFieldName} overrideValues={{ label: LeaseRentOldDwellingsInHousingCompaniesPriceIndexFieldTitles.TYPE, }} diff --git a/src/leases/components/leaseSections/rent/RentItem.tsx b/src/leases/components/leaseSections/rent/RentItem.tsx index 21108955..7300d933 100644 --- a/src/leases/components/leaseSections/rent/RentItem.tsx +++ b/src/leases/components/leaseSections/rent/RentItem.tsx @@ -98,7 +98,7 @@ const RentItem = ({ archived = isArchived(rent), rentType = get(rent, 'type'), oldDwellingsInHousingCompaniesPriceIndex = get(rent, 'old_dwellings_in_housing_companies_price_index', {}), - oldDwellingsInHousingCompaniesPriceIndexType = get(rent, 'old_dwellings_in_housing_companies_price_index_type', null), + oldDwellingsInHousingCompaniesPriceIndexType = get(rent, 'old_dwellings_in_housing_companies_price_index_type'), fixedInitialYearRents = get(rent, 'fixed_initial_year_rents', []), contractRents = get(rent, 'contract_rents', []), indexAdjustedRents = get(rent, 'index_adjusted_rents', []), diff --git a/src/leases/components/leaseSections/rent/RentItemEdit.tsx b/src/leases/components/leaseSections/rent/RentItemEdit.tsx index da287af5..b25e210f 100644 --- a/src/leases/components/leaseSections/rent/RentItemEdit.tsx +++ b/src/leases/components/leaseSections/rent/RentItemEdit.tsx @@ -282,6 +282,7 @@ class RentItemEdit extends PureComponent { diff --git a/src/leases/helpers.ts b/src/leases/helpers.ts index 7f70d2e2..5fd780c4 100644 --- a/src/leases/helpers.ts +++ b/src/leases/helpers.ts @@ -2680,7 +2680,8 @@ export const addRentsFormValuesToPayload = (payload: Record, formVa type: rent.type, start_date: rent.start_date, end_date: rent.end_date, - note: rent.note + note: rent.note, + old_dwellings_in_housing_companies_price_index_type: rent.old_dwellings_in_housing_companies_price_index_type, }; // Patch amount only if rent type is one time