import { createAjaxRoute, lessThanThreeErrors } from '../utils/apiHelpers' import { CUSTOMER_API } from '../../utils/ResourceConstants' import { map } from 'lodash' export const updateUserProperties2 = (userId: number, accessToken: string, property: any) => { const patchOperations = map(property, (value, property) => ({ property, value, operation: 'set' })) return createAjaxRoute({ url: `${CUSTOMER_API}/users/${userId}/properties2`, method: 'PATCH', token: accessToken, body: JSON.stringify(patchOperations), }) .retryWhen(lessThanThreeErrors) .map((data: any) => data.response) }