Skip to content

Commit

Permalink
chore: remove gating on learner credit enrollment upgrades from Dashb…
Browse files Browse the repository at this point in the history
…oard (#1139)
  • Loading branch information
adamstankiewicz authored Aug 1, 2024
1 parent 4ea7549 commit beeacc8
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
import { AppContext } from '@edx/frontend-platform/react';
import { camelCaseObject } from '@edx/frontend-platform/utils';
import { logError } from '@edx/frontend-platform/logging';
import { hasFeatureFlagEnabled, sendEnterpriseTrackEventWithDelay } from '@edx/frontend-enterprise-utils';
import { sendEnterpriseTrackEventWithDelay } from '@edx/frontend-enterprise-utils';
import _camelCase from 'lodash.camelcase';
import _cloneDeep from 'lodash.clonedeep';

Expand Down Expand Up @@ -147,17 +147,13 @@ export const useCourseUpgradeData = ({
}) => {
const location = useLocation();
const canUpgradeToVerifiedEnrollment = isEnrollmentUpgradeable({ mode, enrollBy });
const { authenticatedUser } = useContext(AppContext);
const { data: enterpriseCustomer } = useEnterpriseCustomer();
const { data: customerContainsContent } = useEnterpriseCustomerContainsContent([courseRunKey], {
enabled: canUpgradeToVerifiedEnrollment,
});

// TODO: Remove `isLearnerCreditUpgradeEnabled` flag when rolling out ENT-9135
// Metadata required to allow upgrade via applicable learner credit
const isLearnerCreditUpgradeEnabled = authenticatedUser.administrator || hasFeatureFlagEnabled('LEARNER_CREDIT_AUDIT_UPGRADE');
const { data: learnerCreditMetadata } = useCanUpgradeWithLearnerCredit(courseRunKey, {
enabled: isLearnerCreditUpgradeEnabled && canUpgradeToVerifiedEnrollment,
enabled: canUpgradeToVerifiedEnrollment,
});

// Metadata required to allow upgrade via applicable subscription license
Expand Down Expand Up @@ -190,7 +186,7 @@ export const useCourseUpgradeData = ({
});

const { data: enterpriseCourseEnrollments } = useEnterpriseCourseEnrollments({
enabled: isLearnerCreditUpgradeEnabled && canUpgradeToVerifiedEnrollment,
enabled: canUpgradeToVerifiedEnrollment,
});

const { redeem: redeemLearnerCredit } = useStatefulEnroll({
Expand Down

0 comments on commit beeacc8

Please sign in to comment.