diff --git a/frontend/src/pages/ClientDetailsPage.vue b/frontend/src/pages/ClientDetailsPage.vue index 50e56b281..6207abf55 100644 --- a/frontend/src/pages/ClientDetailsPage.vue +++ b/frontend/src/pages/ClientDetailsPage.vue @@ -116,13 +116,15 @@ const formatLocationsList = ( allLocations: ClientLocation[] = data.value.addresses, ) => { const list: string[] = []; - for (const curLocationCode of locationCodes.toSorted()) { - const location = allLocations.find( - (curLocation) => curLocation.clientLocnCode === curLocationCode, - ); - - const title = formatLocation(location); - list.push(title); + if (Array.isArray(locationCodes)) { + for (const curLocationCode of locationCodes.toSorted()) { + const location = allLocations.find( + (curLocation) => curLocation.clientLocnCode === curLocationCode, + ); + + const title = formatLocation(location); + list.push(title); + } } return list.join(", "); }; diff --git a/frontend/stub/__files/response-clients-details-NL.json b/frontend/stub/__files/response-clients-details-NL.json new file mode 100644 index 000000000..9234b4ad1 --- /dev/null +++ b/frontend/stub/__files/response-clients-details-NL.json @@ -0,0 +1,20 @@ +{ + "registryCompanyTypeCode": "SP", + "corpRegnNmbr": "{{randomValue length=8 type='NUMERIC'}}", + "clientNumber":"{{randomValue length=4 type='NUMERIC'}}", + "clientName": "Scott", + "legalFirstName": "Michael", + "legalMiddleName": "", + "doingBusinessAs": [], + "birthdate": "1962-08-17", + "clientAcronym": "", + "clientTypeCode": "RSP", + "clientTypeDesc": "Registered sole proprietorship", + "goodStandingInd": "N", + "clientStatusCode": "A", + "clientStatusDesc": "Active", + "clientComment": "", + "wcbFirmNumber": "{{randomValue length=7 type='NUMERIC'}}", + "contacts": [], + "addresses": [] +} diff --git a/frontend/stub/mappings/client_details.json b/frontend/stub/mappings/client_details.json index d45f6e257..e06b12113 100644 --- a/frontend/stub/mappings/client_details.json +++ b/frontend/stub/mappings/client_details.json @@ -105,6 +105,21 @@ "fixedDelayMilliseconds": 500 } }, + { + "name": "Client Details Individual - no locations", + "request": { + "urlPattern": "/api/clients/details/[nN][lL](.*)", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "response-clients-details-NL.json", + "transformers": [ + "response-template" + ], + "fixedDelayMilliseconds": 500 + } + }, { "name": "Client Details - Error 400", "request": {