generated from hmcts/expressjs-template
-
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.
* Added the fix for incident * removed the commented code
- Loading branch information
Showing
2 changed files
with
4 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ export const getCourtEmailId = (key: string): string => { | |
['worcester', config.get('localCourt.emailId.WORCESTER_FAMILY_COURT')], | ||
['newport', config.get('localCourt.emailId.NEWPORT_GWENT_FAMILY_COURT')], | ||
['liverpool', config.get('localCourt.emailId.LIVERPOOL_FAMILY_COURT')], | ||
['central london', config.get('localCourt.emailId.CENTRAL_LONDON_FAMILY_COURT')], | ||
['reading', config.get('localCourt.emailId.READING_FAMILY_COURT')], | ||
//Midlands | ||
['stoke-on-trent', config.get('localCourt.emailId.STOKE-ON-TRENT_FAMILY_COURT')], | ||
|
@@ -67,13 +66,13 @@ export const getCourtEmailId = (key: string): string => { | |
['haverfordwest', config.get('localCourt.emailId.HAVERFORDWEST_FAMILY_COURT')], | ||
['llanelli', config.get('localCourt.emailId.LLANELLI_FAMILY_COURT')], | ||
['pontypridd', config.get('localCourt.emailId.PONTYPRIDD_FAMILY_COURT')], | ||
['port-talbot', config.get('localCourt.emailId.PORT_TALBOT_FAMILY_COURT')], | ||
['port talbot', config.get('localCourt.emailId.PORT_TALBOT_FAMILY_COURT')], | ||
['prestatyn', config.get('localCourt.emailId.PRESTATYN_FAMILY_COURT')], | ||
['swansea', config.get('localCourt.emailId.SWANSEA_FAMILY_COURT')], | ||
['wrexham', config.get('localCourt.emailId.WREXHAM_FAMILY_COURT')], | ||
]); | ||
//Creating array of arrays from map. Then filtering key from map based on input string. | ||
const filteredElement = Array.from(map).filter(([mapKey]) => courtKey.includes(mapKey)); | ||
const filteredElement = Array.from(map).filter(([mapKey]) => courtKey.startsWith(mapKey)); | ||
|
||
//filtered element will contain a single array item something like [['liverpool','[email protected]' ]]. | ||
//Using index to get the email element. | ||
|