user1906725
user1906725

Reputation: 55

How can i Solve Problem "X-Total-Count "?

My Backend is with Sails.js , I install React-admin and this Package ra-data-json-sails this is my Code [https://i.sstatic.net/DwUmD.jpg]

and i saw this error

https://i.sstatic.net/8G6zs.jpg

Plz Help me

Thanks

Upvotes: 0

Views: 542

Answers (1)

François Zaninotto
François Zaninotto

Reputation: 7355

In addition to adding the X-Total-Count header in your CORS configuration, you must also return it in the API response to GET_LIST.

This example implementation should help you:

  async.parallel({
    data: getData,
    count: getTotalCount
  }, function (err, results) {
    res.set('X-Total-Count', results.count);
    res.ok(results.data);
  });

More details at https://gist.github.com/aantipov/8ee3b7607ab9e01e4ede

Upvotes: 1

Related Questions