Skip to content

Commit

Permalink
Add query arg (#90045)
Browse files Browse the repository at this point in the history
  • Loading branch information
niranjan-uma-shankar authored Apr 30, 2024
1 parent b4faecd commit 484dc5b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 ) );
Expand Down

0 comments on commit 484dc5b

Please sign in to comment.