title: Change axios Response Schema
body: <p>As <a href="https://github.com/axios/axios#response-schema" rel="nofollow noreferrer">axios GitHub</a> page states, default response of axios request is:</p>
  
  <pre><code>{
    // `data` is the response that was provided by the server
    data: {},
  
    // `status` is the HTTP status code from the server response
    status: 200,
  
    // `statusText` is the HTTP status message from the server response
    statusText: 'OK',
  
    // `headers` the headers that the server responded with
    // All header names are lower cased
    headers: {},
  
    // `config` is the config that was provided to `axios` for the request
    config: {},
  
    // `request` is the request that generated this response
    // It is the last ClientRequest instance in node.js (in redirects)
    // and an XMLHttpRequest instance in the browser
    request: {}
  }
  </code></pre>
  
  <p><strong>Problem:</strong></p>
  
  <p>My API response schema is:</p>
  
  <pre><code>{
    success: true,
    message: '',
    data: {}
  }
  </code></pre>
  
  <p>So every time I make a request, I have to handle the response like:</p>
  
  <pre><code>(...).then((res) =&gt; res.data.data);
  </code></pre>
  
  <p>How can I change the response schema of axios to avoid doing <code>.data.data</code> every time?</p>