Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 1379fd4

Browse files
committed
cleanup
1 parent 448a59c commit 1379fd4

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

admin-ui/src/component/applications/Application.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ function Application(): JSX.Element | null {
378378
return <Loader />;
379379
}
380380

381+
if (!application) {
382+
return null;
383+
}
384+
381385
const notificationContent: { heading: string; body: string } | undefined =
382386
statusNotification
383387
? {

admin-ui/src/component/applications/ApplicationDetails.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ function ApplicationDetails(): JSX.Element | null {
214214
return <Loader />;
215215
}
216216

217+
if (!application) {
218+
return null;
219+
}
220+
217221
const isOrganisation = Boolean(application?.organisation);
218222

219223
const hasBillingAddress =

admin-ui/src/component/applications/ReservationByApplicationEvent.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ function ReservationByApplicationEvent(): JSX.Element | null {
151151
return <Loader />;
152152
}
153153

154+
if (!application) {
155+
return null;
156+
}
157+
154158
const customerName = applicantName(application);
155159

156160
const applicationEvent: ApplicationEvent | undefined =

admin-ui/src/component/applications/util.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import {
99
} from "../../common/types";
1010
import { formatDuration } from "../../common/util";
1111

12-
export const applicantName = (app: Application | null): string => {
13-
if (app === null) {
14-
return "null";
15-
}
16-
12+
export const applicantName = (app: Application): string => {
1713
return app.applicantType === "individual"
1814
? `${app.contactPerson?.firstName || "-"} ${
1915
app.contactPerson?.lastName || "-"

0 commit comments

Comments
 (0)