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

Fix units availability display #1398

Merged
merged 2 commits into from
Jun 24, 2021
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file. The format
- POST `/users` endpoint response from StatusDTO to UserBasicDto (Michał Plebański)
- Replaces `toPrecision` function on `units-transformations` to `toFixed` ([#1304](https://github.com/bloom-housing/bloom/pull/1304)) (Marcin Jędras)
- "totalFlagged" computation and a race condition on Application insertion ([#1366](https://github.com/bloom-housing/bloom/pull/1366))
- Fix units availability ([#1397](https://github.com/bloom-housing/bloom/issues/1397))

- Added:

Expand All @@ -40,6 +41,7 @@ All notable changes to this project will be documented in this file. The format
### Frontend

- Added:

- Adds filtering capability to listings list and implements on public site ([#1351](https://github.com/bloom-housing/bloom/pull/1359))
- Listings Management pieces added to Parnter's app, including add and detail pages
- add accessible at `/listings/add`
Expand Down
2 changes: 1 addition & 1 deletion backend/core/src/shared/units-transformations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const summarizeUnitsByTypeAndRent = (units: Units, reservedType?: string): UnitS
const finalSummary = unitMap[key].reduce((summary, unit, index) => {
return getUnitsSummary(unit, index === 0 ? null : summary)
}, {} as UnitSummary)
finalSummary.totalAvailable = unitMap[key].length
finalSummary.totalAvailable = unitMap[key].filter((unit) => unit.status === "available").length
summaries.push(finalSummary)
}

Expand Down