From a380b6398ab7e352f4f3521982e2f7c9881884f3 Mon Sep 17 00:00:00 2001 From: Juan Castillo Date: Tue, 7 Jan 2025 10:51:37 -0800 Subject: [PATCH] Update after merge conflict --- .../components/ReferralTaskCardWithReferral.jsx | 3 +++ src/applications/vaos/referral-appointments/utils/referrals.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/applications/vaos/referral-appointments/components/ReferralTaskCardWithReferral.jsx b/src/applications/vaos/referral-appointments/components/ReferralTaskCardWithReferral.jsx index 9c99db18df0e..7199a655985a 100644 --- a/src/applications/vaos/referral-appointments/components/ReferralTaskCardWithReferral.jsx +++ b/src/applications/vaos/referral-appointments/components/ReferralTaskCardWithReferral.jsx @@ -7,6 +7,9 @@ import ReferralTaskCard from './ReferralTaskCard'; import { FETCH_STATUS } from '../../utils/constants'; const isExpired = referral => { + if (!referral?.ReferralExpirationDate) { + return false; + } const expirationDate = referral.ReferralExpirationDate; const now = new Date(); const expiration = new Date(expirationDate); diff --git a/src/applications/vaos/referral-appointments/utils/referrals.js b/src/applications/vaos/referral-appointments/utils/referrals.js index 566cdce54d21..814c30ecb62a 100644 --- a/src/applications/vaos/referral-appointments/utils/referrals.js +++ b/src/applications/vaos/referral-appointments/utils/referrals.js @@ -95,8 +95,8 @@ const createReferrals = ( referrals.push( createReferral( referralDate, - providerIds[i % providerIds.length], `${uuidBase}${i.toString().padStart(2, '0')}`, + providerIds[i % providerIds.length], isExpired ? format(addDays(startDate, 6), mydFormat) : undefined, ), );