diff --git a/client/components/mma/dataPrivacy/DataPrivacyPage.tsx b/client/components/mma/dataPrivacy/DataPrivacyPage.tsx index d57d2e3cb..e3ef2cd80 100644 --- a/client/components/mma/dataPrivacy/DataPrivacyPage.tsx +++ b/client/components/mma/dataPrivacy/DataPrivacyPage.tsx @@ -9,6 +9,7 @@ import { } from '../../../utilities/hooks/useAsyncLoader'; import { GenericErrorScreen } from '../../shared/GenericErrorScreen'; import { WithStandardTopMargin } from '../../shared/WithStandardTopMargin'; +import { APIUseCredentials, identityFetch } from '../identity/idapi/fetch'; import * as UserAPI from '../identity/idapi/user'; import { ConsentOptions, mapSubscriptions } from '../identity/identity'; import { IdentityLocations } from '../identity/IdentityLocations'; @@ -22,7 +23,7 @@ import { dataPrivacyWrapper } from './DataPrivacy.styles'; import { LearnMoreSection } from './LearnMoreSection'; import { YourDataSection } from './YourDataSection'; -type DataPrivacyResponse = [ConsentOption[], UserAPI.UserAPIResponse]; +type DataPrivacyResponse = [ConsentOption[], UserAPI.UserAPIResponse, any]; const dataPrivacyFetcher = () => Promise.all([ @@ -34,6 +35,7 @@ const dataPrivacyFetcher = () => }, ), fetchWithDefaultParameters('/idapi/user'), + identityFetch('/users/me/consents', APIUseCredentials({})), ]); export const DataPrivacyPage = () => { @@ -73,7 +75,8 @@ export const DataPrivacyPage = () => { * @param {DataPrivacyResponse} response */ const handleResponse = (response: DataPrivacyResponse) => { - const [consentOptions, userResponse] = response; + const [consentOptions, userResponse, consentResponse] = response; + console.log('CONSENT RESPONSE', consentResponse); const user = UserAPI.toUser(userResponse); const consentOpt = mapSubscriptions(user.consents, consentOptions); dispatch(options(consentOpt));