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, },