Skip to content

Commit

Permalink
refactor: use sha status to check if user is registered (#560)
Browse files Browse the repository at this point in the history
* refactor: use sha status to check if user is registered

* refactor: code review changes from @donaldkibet
  • Loading branch information
amosmachora authored Jan 21, 2025
1 parent 7cf8418 commit efd3a5b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const SHANumberValidity: React.FC<SHANumberValidityProps> = ({ paymentMethod, pa

const { data, isLoading: isLoadingHIEEligibility, error } = useSHAEligibility(patientUuid, shaIdentificationNumber);

const isRegisteredOnSHA = Boolean(data?.coverageEndDate) && Boolean(data?.coverageStartDate);
const isNotRegisteredOnSHA = data?.status === 0;
const isRegisteredOnSHA = data?.status === 1;

const isActive = isRegisteredOnSHA
? isWithinInterval(new Date(), {
Expand Down Expand Up @@ -76,7 +75,7 @@ const SHANumberValidity: React.FC<SHANumberValidityProps> = ({ paymentMethod, pa
);
}

if (isNotRegisteredOnSHA) {
if (!isRegisteredOnSHA) {
return (
<InlineNotification
title={t('HIEVerificationFailure', 'HIE verification failure')}
Expand Down

0 comments on commit efd3a5b

Please sign in to comment.