Skip to content

Commit

Permalink
Implement forgotten isOnExpirationList check
Browse files Browse the repository at this point in the history
The relevant backend code was still in development when I set this
up, and I forgot to update it 🤦
  • Loading branch information
Vinnl committed Jan 29, 2025
1 parent b076aff commit 68ae41c
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { logger } from "../../../../../functions/server/logging";
import { checkChurnCouponCode } from "../../../../../functions/server/applyCoupon";
import { applyRenewalCoupon } from "./actions";
import { getEnabledFeatureFlags } from "../../../../../../db/tables/featureFlags";
import { getChurnsToEmail } from "../../../../../../db/tables/subscriber_churns";

export default async function PlusExpirationPage() {
const session = await getServerSession();
Expand Down Expand Up @@ -40,16 +41,20 @@ export default async function PlusExpirationPage() {
}

const couponCheckResult = await checkChurnCouponCode(subscriber);
const subscribersToEmail = await getChurnsToEmail();

return (
<View
subscriber={subscriber}
couponCheckResult={couponCheckResult}
applyCouponAction={applyRenewalCoupon}
manageSubscriptionsUrl={process.env.FXA_SUBSCRIPTIONS_URL!}
// TODO: When we can fetch a list of users whose subscriptions are expiring,
// set this value correctly.
isOnExpirationList={false}
isOnExpirationList={
typeof subscribersToEmail.find(
(subscriberToEmail) =>
subscriberToEmail.userid === subscriber.fxa_uid,
) !== "undefined"
}
/>
);
}

0 comments on commit 68ae41c

Please sign in to comment.