RickWong/fetch-plus

Error when getting output as a json object

ngduc opened this issue · 1 comments

ngduc commented

Hi,
I followed your boilerplate with the githubApi example but in my case, the api returns a json object {...} instead of an array of objects. It gave me a range error. I think fetch-plus expects an array in the output. Is that true?

const _fetchInitialData = () => {
  return myApi.browse(
    ['posts', '1'], {}

Thanks.

ngduc commented

My bad, I changed my code to use myApi.read. It works fine now. Thanks.