Skip to content

Commit

Permalink
Enable AB test
Browse files Browse the repository at this point in the history
  • Loading branch information
rupertbates committed Jan 16, 2025
1 parent c181445 commit 8263a51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dotcom-rendering/src/client/userFeatures/user-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

import { getAuthStatus, isUserLoggedInOktaRefactor } from '../../lib/identity';
import { useAB } from '../../lib/useAB';
import {
adFreeDataIsPresent,
getAdFreeCookie,
Expand Down Expand Up @@ -53,9 +54,8 @@ const refresh = async (): Promise<void> => {
};

const shouldUseUserBenefitsApi = (): boolean => {
return true;
// const abTestAPI = useAB()?.api;
// return !!abTestAPI?.isUserInVariant('UserBenefitsApi', 'variant');
const abTestAPI = useAB()?.api;

Check failure on line 57 in dotcom-rendering/src/client/userFeatures/user-features.ts

View workflow job for this annotation

GitHub Actions / lint / check

React Hook "useAB" is called in function "shouldUseUserBenefitsApi" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"
return !!abTestAPI?.isUserInVariant('UserBenefitsApi', 'variant');
};

const requestNewData = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const syncDataFromUserBenefitsApi = async (
): Promise<UserBenefits> => {
const response = await fetchJson(
window.guardian.config.page.userBenefitsApiUrl ??
'https://user-benefits.code.dev-guardianapis.com/benefits/me',
'/USER_BENEFIT_API_NOT_FOUND',
{
mode: 'cors',
...getOptionsHeadersWithOkta(signedInAuthStatus),
Expand Down

0 comments on commit 8263a51

Please sign in to comment.