generated from companieshouse/node-review-web-starter-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #598 from companieshouse/bug/IDVA5-1722-Correspond…
…ence-address-country Fixing Correspondence address country input not showing on back
- Loading branch information
Showing
6 changed files
with
34 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
import { AcspData } from "@companieshouse/api-sdk-node/dist/services/acsp"; | ||
|
||
export class WhereDoYouLivBodyService { | ||
public getCountryPayload (ascpData: AcspData): { payload: any, countryInput?: string } { | ||
public getCountryPayload (ascpData: AcspData) { | ||
let payload = {}; | ||
let countryInput: string | undefined; | ||
|
||
switch (ascpData.applicantDetails?.countryOfResidence) { | ||
if (!ascpData.applicantDetails?.countryOfResidence) { | ||
return payload; | ||
} | ||
|
||
switch (ascpData.applicantDetails.countryOfResidence) { | ||
case "England": | ||
case "Scotland": | ||
case "Wales": | ||
case "Northern Ireland": | ||
payload = { whereDoYouLiveRadio: ascpData?.applicantDetails?.countryOfResidence }; | ||
payload = { whereDoYouLiveRadio: ascpData.applicantDetails?.countryOfResidence }; | ||
break; | ||
default: | ||
if (ascpData.applicantDetails?.countryOfResidence) { | ||
payload = { whereDoYouLiveRadio: "countryOutsideUK" }; | ||
countryInput = ascpData.applicantDetails?.countryOfResidence; | ||
} | ||
break; | ||
|
||
payload = { | ||
whereDoYouLiveRadio: "countryOutsideUK", | ||
countryInput: ascpData.applicantDetails.countryOfResidence | ||
}; | ||
} | ||
return { payload, countryInput }; | ||
return payload; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters