From c1c9b9e1b7bfb12c6b041aa8efefc2b8cf97cb20 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Tue, 3 Mar 2026 13:16:03 +0100 Subject: [PATCH] [web] Target all group subscriptions on Survey configuration (#31928) Update the toggle behaviour to target all group subscription users, regardless of whether they are in Recurly or Stripe. GitOrigin-RevId: a3e72d93e440a8941472f868e387a654b8908d1f --- .../app/src/Features/Subscription/SubscriptionLocator.mjs | 3 +-- services/web/app/src/Features/Survey/SurveyHandler.mjs | 8 ++++---- services/web/app/src/models/Survey.mjs | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/services/web/app/src/Features/Subscription/SubscriptionLocator.mjs b/services/web/app/src/Features/Subscription/SubscriptionLocator.mjs index ace3a7beae..b6c56087cc 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionLocator.mjs +++ b/services/web/app/src/Features/Subscription/SubscriptionLocator.mjs @@ -71,12 +71,11 @@ const SubscriptionLocator = { return subscription?.admin_id }, - async hasRecurlyGroupSubscription(userOrId) { + async hasGroupSubscription(userOrId) { if (!Features.hasFeature('saas')) return false const userId = SubscriptionLocator._getUserId(userOrId) return await Subscription.exists({ groupPlan: true, - recurlySubscription_id: { $exists: true }, $or: [ { member_ids: userId }, { manager_ids: userId }, diff --git a/services/web/app/src/Features/Survey/SurveyHandler.mjs b/services/web/app/src/Features/Survey/SurveyHandler.mjs index c989409afc..767c351b09 100644 --- a/services/web/app/src/Features/Survey/SurveyHandler.mjs +++ b/services/web/app/src/Features/Survey/SurveyHandler.mjs @@ -19,10 +19,10 @@ import UserGetter from '../User/UserGetter.mjs' async function getSurvey(userId) { const survey = await SurveyCache.get(true) if (survey) { - if (survey.options?.hasRecurlyGroupSubscription) { - const hasRecurlyGroupSubscription = - await SubscriptionLocator.promises.hasRecurlyGroupSubscription(userId) - if (!hasRecurlyGroupSubscription) { + if (survey.options?.hasGroupSubscription) { + const hasGroupSubscription = + await SubscriptionLocator.promises.hasGroupSubscription(userId) + if (!hasGroupSubscription) { return } } diff --git a/services/web/app/src/models/Survey.mjs b/services/web/app/src/models/Survey.mjs index 70b439a90d..4261d5ae87 100644 --- a/services/web/app/src/models/Survey.mjs +++ b/services/web/app/src/models/Survey.mjs @@ -36,7 +36,7 @@ export const SurveySchema = new Schema( required: true, }, options: { - hasRecurlyGroupSubscription: { + hasGroupSubscription: { type: Boolean, default: false, },