import { createAjaxRoute, lessThanThreeErrors } from '../utils/apiHelpers' import { CUSTOMER_API } from '../../utils/ResourceConstants' import { IProfile } from './interfaces' export const fetchProfile = (userId: number, accessToken: string) => { return createAjaxRoute({ url: `${CUSTOMER_API}/users/${userId}/profile`, method: 'GET', token: accessToken, }) .retryWhen(lessThanThreeErrors) .map((data: any): IProfile => data.response) }