From a889752fa80e970e25faa43db57a2622c28392d4 Mon Sep 17 00:00:00 2001 From: Chris Risner Date: Wed, 12 Jun 2024 10:03:32 -0500 Subject: [PATCH] feat(DL): made drivers license optional field --- .../sections/DriverLicense/JointLicense.tsx | 17 ++--------------- .../sections/DriverLicense/PrimaryLicense.tsx | 17 ++--------------- src/lib/actions/slack.helpers.ts | 10 ++++++---- typings.d.ts | 4 ++-- 4 files changed, 12 insertions(+), 36 deletions(-) diff --git a/src/components/sections/DriverLicense/JointLicense.tsx b/src/components/sections/DriverLicense/JointLicense.tsx index 870bc72..3fbfc53 100644 --- a/src/components/sections/DriverLicense/JointLicense.tsx +++ b/src/components/sections/DriverLicense/JointLicense.tsx @@ -14,15 +14,14 @@ const JointLicense = () => {
- { cats={states} errormsg={errors?.co_licenseState?.message!} /> - {/* */}
diff --git a/src/components/sections/DriverLicense/PrimaryLicense.tsx b/src/components/sections/DriverLicense/PrimaryLicense.tsx index 2f5916c..1bf92b0 100644 --- a/src/components/sections/DriverLicense/PrimaryLicense.tsx +++ b/src/components/sections/DriverLicense/PrimaryLicense.tsx @@ -6,7 +6,6 @@ import { useFormContext } from 'react-hook-form' const PrimaryLicense = () => { const { register, - formState: { errors }, } = useFormContext() @@ -15,14 +14,14 @@ const PrimaryLicense = () => {
{ cats={states} errormsg={errors?.licenseState?.message!} /> - {/* */}
diff --git a/src/lib/actions/slack.helpers.ts b/src/lib/actions/slack.helpers.ts index 42582f5..b1a0108 100644 --- a/src/lib/actions/slack.helpers.ts +++ b/src/lib/actions/slack.helpers.ts @@ -46,11 +46,13 @@ export function formatSlackApplicant(applicant: CreditApplicant, role: 'Primary' ) ) } - blocks.push( - createSlackSection( - `*Drivers License*\n*License number:* ${applicant.licenseNumber}\n*State:* ${applicant.licenseState}` + if (applicant.licenseNumber && applicant.licenseState) { + blocks.push( + createSlackSection( + `*Drivers License*\n*License number:* ${applicant.licenseNumber}\n*State:* ${applicant.licenseState}` + ) ) - ) + } blocks.push( createSlackSection( `*Employment History*\n*Employer name:* ${applicant.employerName}\n*Employment Status:* ${ diff --git a/typings.d.ts b/typings.d.ts index e365a7d..74bd3e6 100644 --- a/typings.d.ts +++ b/typings.d.ts @@ -24,8 +24,8 @@ export interface CreditApplicant { addressYears: string addressMonths: string rentMortgagePaymentAmount: string - licenseNumber: string - licenseState: string + licenseNumber?: string + licenseState?: string employerName: string employmentStatusCode: string employerPhone: string