import axios , { AxiosResponse } from 'axios' ; import { prefixRes } from './http-config' ; import { logMessage } from './log' ; export function transformInterceptor ( ) { axios . interceptors . response . use ( ( response ) => { const { data } = response ; const transformed = data . data || data ; logMessage ( `${ prefixRes } 🚧 Transform Response` , [ ] , [ transformed ] ) ; response . data = transformed ; return response ; } ) ; }