title: Creating a custom rest client admin-on-rest
body: <p>I'm not asking for help I just think you have something wrong with the custom json-server implementation.
  I'm using: "admin-on-rest": "^1.1.0"</p>
  
  <p>This is my App.js:</p>
  
  <pre><code>...
  import restClient from './restClient';
  
  const App = () =&gt; (
    &lt;Admin
      title="Glasses"
      dashboard={Dashboard}
      menu={Menu}
      restClient={restClient}
      authClient={authClient}
    &gt;
      &lt;Resource name="products" list={ProductList} /&gt;
    &lt;/Admin&gt;
  );
  </code></pre>
  
  <p>The restClient.js file is a copy of <a href="https://github.com/marmelab/admin-on-rest/blob/master/src/rest/jsonServer.js" rel="nofollow noreferrer">https://github.com/marmelab/admin-on-rest/blob/master/src/rest/jsonServer.js</a> I just changed the import paths like this:</p>
  
  <pre><code>import {
    GET_LIST,
    GET_ONE,
    GET_MANY,
    GET_MANY_REFERENCE,
    CREATE,
    UPDATE,
    DELETE,
    fetchUtils
  } from 'admin-on-rest';
  
  const { queryParameters, fetchJson } = fetchUtils;
  ...
  </code></pre>
  
  <p>The rest of the restClient.js is one by one as in the git "jsonServer.js".</p>
  
  <p>When I click on "products" in my menu, I got a notification: "REST response must contain a data key" and in the console: "Warning: Missing translation for key: "REST response must contain a data key"</p>
  
  <p>Now of course it looks like the server doesn't return "data" object in the response BUT the problem is that there is no even request! when I go to my "networks" tab (in chrome console filter to All networks) I don't see any request to the API so how it is possible to receive this kind of error?</p>
  
  <p>I added "console.log" to the first row of this code in the bottom of my restClient.js file (jsonServer.js):</p>
  
  <pre><code>return (type, resource, params) =&gt; {
      console.log('test'); // THIS WHAT I ADDED
      // json-server doesn't handle WHERE IN requests, so we fallback to calling GET_ONE n times instead
      if (type === GET_MANY) {
        return Promise.all(params.ids.map(id =&gt; httpClient(`${apiUrl}/${resource}/${id}`)))
          .then(responses =&gt; ({ data: responses.map(response =&gt; response.json) }));
      }
      const { url, options } = convertRESTRequestToHTTP(type, resource, params);
      return httpClient(url, options)
        .then(response =&gt; convertHTTPResponseToREST(response, type, resource, params));
    };
  </code></pre>
  
  <p>but the "test" is not been printed to the console.</p>
  
  <p>Any advice? Did I do something wrong?</p>
  
  <p>Video which can help: <a href="https://nimbus.everhelper.me/client/notes/share/982310/35f8rwpu6qohrftn8h1h" rel="nofollow noreferrer">https://nimbus.everhelper.me/client/notes/share/982310/35f8rwpu6qohrftn8h1h</a>
  The restClient.js file: <a href="http://pasted.co/2024e00f" rel="nofollow noreferrer">http://pasted.co/2024e00f</a></p>
  
  <p>Thank you in advanced.</p>
  
  <p>Leo.</p>