Skip to content

Commit

Permalink
Bug Fixes (#120)
Browse files Browse the repository at this point in the history
## Changes

<!-- What changes did you make? -->

- fix null HL crash bug
- fix keys on unit grid
  • Loading branch information
petabite authored Jun 27, 2024
1 parent 9bf862f commit 7f4389a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/api/referrals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type CreateReferralRequest = {

export type UpdateReferralRequest = {
id: string;
housingLocator: string;
housingLocator?: string;
referringStaff: string;
status: string;
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export type Referral = {
status: ReferralStatus;
renterCandidate: RenterCandidate;
unit: Unit;
assignedHousingLocator: User;
assignedHousingLocator?: User;
assignedReferringStaff: User;
updatedAt: string;
createdAt: string;
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/ReferralTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ export const ReferralTable = (props: ReferralTableProps) => {
}
return (
<>
{referral.assignedHousingLocator.firstName + " " + referral.assignedHousingLocator.lastName}
{referral.assignedHousingLocator
? referral.assignedHousingLocator.firstName +
" " +
referral.assignedHousingLocator.lastName
: "N/A"}
</>
);
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/UnitCardGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const UnitCardGrid = ({
refreshUnits={() => {
refreshUnits(showPendingUnits ? "pending" : "approved");
}}
key={index}
key={`${option.listingAddress}_${index}`}
/>
))}
{units.length === 0 && <HeaderText>No matching units found</HeaderText>}
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/pages/RenterCandidatePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,11 @@ export function RenterCandidatePage() {
}
return (
<>
{referral.assignedHousingLocator.firstName + " " + referral.assignedHousingLocator.lastName}
{referral.assignedHousingLocator
? referral.assignedHousingLocator.firstName +
" " +
referral.assignedHousingLocator.lastName
: "N/A"}
</>
);
};
Expand Down Expand Up @@ -659,7 +663,11 @@ export function RenterCandidatePage() {
{unit.listingAddress}
</ListingAddressLink>,
assignedReferringStaff.firstName + " " + assignedReferringStaff.lastName,
assignedHousingLocator.firstName + " " + assignedHousingLocator.lastName,
assignedHousingLocator
? assignedHousingLocator.firstName +
" " +
assignedHousingLocator.lastName
: "N/A",
status,
formatDate(updatedAt.toString()),
<DeleteIcon
Expand Down

0 comments on commit 7f4389a

Please sign in to comment.