Skip to content

Commit

Permalink
fix: trim trailing angle brackets on passport number for centrix
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed Feb 20, 2018
1 parent 33be607 commit d2e2c36
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/samplebot/plugins/centrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ function getType(stub) {
function getLink(stub) {
return stub.id.split('_')[2]
}

async function getCentrixData ({ application, bot }) {
if (!application) return

Expand All @@ -230,6 +231,11 @@ async function getCentrixData ({ application, bot }) {
const docType = getDocumentType(form)
let { firstName, lastName, birthData, dateOfBirth, sex } = personal
let { dateOfExpiry, documentNumber } = document
if (docType === DOCUMENT_TYPES.passport) {
// trim trailing angle brackets
documentNumber = documentNumber.replace(/[<]+$/g, '')
}

if (dateOfExpiry)
dateOfExpiry = toISODateString(dateOfExpiry)

Expand Down

0 comments on commit d2e2c36

Please sign in to comment.