Skip to content

Commit fadbf2c

Browse files
committed
fix : updated confirmation form adress format
1 parent b2ffef3 commit fadbf2c

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/ui/SurveyUnit/Communication/CommunicationConfirmation.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,11 @@ const CommunicationConfirmation = ({
2929
bypassReasonLabel,
3030
}: CommunicationConfirmationProps) => {
3131
const address = getAddressData(surveyUnit.address);
32-
const addressLines = Object.values(address).filter(v => !!v);
3332
const recipient = getprivilegedPerson(surveyUnit);
3433
const { user } = useUser();
35-
3634
const userError = userSchema.safeParse(user);
3735
const recipientError = recipientSchema.safeParse({ ...address, ...recipient });
3836
const communicationError = communicationSchema.safeParse(communication);
39-
4037
const isValid = userError.success && recipientError.success && communicationError.success;
4138

4239
return (
@@ -89,12 +86,22 @@ const CommunicationConfirmation = ({
8986
>
9087
{getTitle(recipient.title)} {recipient.firstName} {recipient.lastName}
9188
<br />
92-
{addressLines.map(line => (
93-
<Fragment key={line.toString()}>
94-
{line}
95-
<br />
89+
<Fragment>
90+
{address.streetName} <br />
91+
</Fragment>
92+
{address.additionalAddress.length > 0 && (
93+
<Fragment>
94+
{address.additionalAddress} <br />
9695
</Fragment>
97-
))}
96+
)}
97+
{address.locality.length > 0 && (
98+
<Fragment>
99+
{address.locality} <br />
100+
</Fragment>
101+
)}
102+
<Fragment>
103+
{address.postCode}, {address.cityName}
104+
</Fragment>
98105
</Typography>
99106
{!recipientError.success && <ValidationError error={recipientError.error} mt={1} />}
100107
</div>

0 commit comments

Comments
 (0)