This repository was archived by the owner on Feb 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
recurring-reservations/application-rounds/[id] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8608,6 +8608,7 @@ export type RejectedOccurrencesQuery = {
86088608 firstName: string;
86098609 lastName: string;
86108610 } | null;
8611+ organisation?: { id: string; name: string } | null;
86118612 };
86128613 };
86138614 reservationUnit: {
@@ -15492,6 +15493,10 @@ export const RejectedOccurrencesDocument = gql`
1549215493 firstName
1549315494 lastName
1549415495 }
15496+ organisation {
15497+ id
15498+ name
15499+ }
1549515500 }
1549615501 }
1549715502 reservationUnit {
Original file line number Diff line number Diff line change @@ -71,15 +71,22 @@ export const reservationToInterval = (
7171 } ;
7272} ;
7373
74+ // NOTE optionals (?) are super bad because if you forget to query anything from the object there will be no type errors
75+ // can't remove them because they are not mandatory in the gql schema
76+ // maybe using an utility function that forces subobjects to NonNullable could work for this.
7477type Application = {
7578 applicantType ?:
7679 | Pick < ApplicationNode , "applicantType" > [ "applicantType" ]
77- | null ;
78- contactPerson ?: Pick < PersonNode , "firstName" | "lastName" > | null ;
79- organisation ?: Pick <
80- NonNullable < Pick < ApplicationNode , "organisation" > [ "organisation" ] > ,
81- "name"
82- > | null ;
80+ | null
81+ | undefined ;
82+ contactPerson ?: Pick < PersonNode , "firstName" | "lastName" > | null | undefined ;
83+ organisation ?:
84+ | Pick <
85+ NonNullable < Pick < ApplicationNode , "organisation" > [ "organisation" ] > ,
86+ "name"
87+ >
88+ | null
89+ | undefined ;
8390} ;
8491export function getApplicantName ( app ?: Application | undefined | null ) : string {
8592 if ( ! app ) {
Original file line number Diff line number Diff line change @@ -857,7 +857,7 @@ function ApplicationDetails({
857857 application ?. billingAddress != null &&
858858 ! isEqual ( application ?. billingAddress , application ?. organisation ?. address ) ;
859859
860- const customerName = application != null ? getApplicantName ( application ) : "" ;
860+ const customerName = getApplicantName ( application ) ;
861861 // TODO where is this defined in the application form?
862862 const homeCity = application ?. homeCity ?. nameFi ?? "-" ;
863863
Original file line number Diff line number Diff line change @@ -176,9 +176,7 @@ export function AllocatedCard({
176176 // TODO should compare the allocated to the suitable time ranges, not to selection
177177 const isTimeMismatch = false ;
178178
179- const applicantName = applicationSection . application
180- ? getApplicantName ( applicationSection . application )
181- : "-" ;
179+ const applicantName = getApplicantName ( applicationSection . application ) ;
182180 const isLoading = isResetLoading || isRefreshLoading ;
183181
184182 return (
@@ -284,9 +282,7 @@ export function SuitableTimeCard({
284282 reservationUnitOptionPk,
285283 refresh,
286284 } ) ;
287- const applicantName = applicationSection . application
288- ? getApplicantName ( applicationSection . application )
289- : "-" ;
285+ const applicantName = getApplicantName ( applicationSection . application ) ;
290286
291287 const isDisabled = ! reservationUnitOptionPk || ! isAllocationEnabled ;
292288
Original file line number Diff line number Diff line change @@ -177,6 +177,10 @@ export const REJECTED_OCCURRENCES_QUERY = gql`
177177 firstName
178178 lastName
179179 }
180+ organisation {
181+ id
182+ name
183+ }
180184 }
181185 }
182186 reservationUnit {
You can’t perform that action at this time.
0 commit comments