Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rent tab: edit old_dwellings_in_housing_companies_price_index_type #554

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
rent tab: edit old_dwellings_in_housing_companies_price_index_type
  • Loading branch information
NC-jsAhonen committed Dec 11, 2024
commit e63c120840a73f7a0a33c1017ec526f8250badf0
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { getReviewDays } from "@/leases/helpers";
type Props = {
oldDwellingsInHousingCompaniesPriceIndex: OldDwellingsInHousingCompaniesPriceIndexProps;
oldDwellingsInHousingCompaniesPriceIndexType: OldDwellingsInHousingCompaniesPriceIndexType;
typeFieldName: string;
leaseAttributes: Attributes;
leaseStartDate: string;
isSaveClicked: boolean;
Expand All @@ -53,6 +54,7 @@ class OldDwellingsInHousingCompaniesPriceIndexEdit extends PureComponent<Props>
const {
oldDwellingsInHousingCompaniesPriceIndex,
oldDwellingsInHousingCompaniesPriceIndexType,
typeFieldName,
leaseAttributes,
leaseStartDate,
isSaveClicked,
Expand All @@ -77,7 +79,7 @@ class OldDwellingsInHousingCompaniesPriceIndexEdit extends PureComponent<Props>
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,
}}
Expand Down
2 changes: 1 addition & 1 deletion src/leases/components/leaseSections/rent/RentItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', []),
Expand Down
1 change: 1 addition & 0 deletions src/leases/components/leaseSections/rent/RentItemEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ class RentItemEdit extends PureComponent<Props, State> {
<OldDwellingsInHousingCompaniesPriceIndexEdit
oldDwellingsInHousingCompaniesPriceIndex={oldDwellingsInHousingCompaniesPriceIndex}
oldDwellingsInHousingCompaniesPriceIndexType={oldDwellingsInHousingCompaniesPriceIndexType}
typeFieldName={`${field}.old_dwellings_in_housing_companies_price_index_type`}
/>
</Collapse>
</Authorization>
Expand Down
3 changes: 2 additions & 1 deletion src/leases/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,8 @@ export const addRentsFormValuesToPayload = (payload: Record<string, any>, 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
Expand Down
Loading