From 484dc5b0867fc9fb3c0bfe9ae4f4a9dfc115a4b5 Mon Sep 17 00:00:00 2001 From: niranjan-uma-shankar Date: Tue, 30 Apr 2024 15:07:12 +0400 Subject: [PATCH] Add query arg (#90045) --- .../block-library/pricing-plans/hooks/pricing-plans.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/happy-blocks/block-library/pricing-plans/hooks/pricing-plans.ts b/apps/happy-blocks/block-library/pricing-plans/hooks/pricing-plans.ts index 914dd069465842..e3d2f0c5ce8a79 100644 --- a/apps/happy-blocks/block-library/pricing-plans/hooks/pricing-plans.ts +++ b/apps/happy-blocks/block-library/pricing-plans/hooks/pricing-plans.ts @@ -2,6 +2,7 @@ import { calculateMonthlyPriceForPlan, getPlan, Plan } from '@automattic/calypso import formatCurrency from '@automattic/format-currency'; import { useEffect, useState } from '@wordpress/element'; import { sprintf, __ } from '@wordpress/i18n'; +import { addQueryArgs } from '@wordpress/url'; import wpcomRequest from 'wpcom-proxy-request'; import config from '../config'; import { ApiPricingPlan } from '../types.js'; @@ -56,9 +57,13 @@ const usePricingPlans = () => { const fetchPlans = async () => { setIsLoading( true ); setError( null ); + const url = addQueryArgs( '/plans', { + locale: config.locale, + eligible_request_for_experiment: true, + } ); try { const data: ApiPricingPlan[] = await wpcomRequest( { - path: '/plans?locale=' + config.locale, + path: url, apiVersion: '1.5', } ); setPlans( parsePlans( data ) );