Ideas for Arc XP

Typo in useContent doc

I see a typo in https://prisa.arcpublishing.com/alc/arc-products/pagebuilder/fusion/documentation/recipes/fetching-content-with-hooks.md?version=2.2

 

It's where define the transform property as an arrow function. Colon symbol and arrow are missing.

 

It should be:

...
  const movies = useContent({
    source: 'movie-search', 
    query: { movieQuery: 'Jurassic' }, 
    filter: '{ totalResults Search { Title Year Poster } }',
    transform: (data) => {
      // Check if data is being returned
      if(data && data.Search)
        return { list: [...data.Search] };

      // Otherwise just keep the current list of movies
      else
        return movies;
    },
  })
...

instead of:

...
  const movies = useContent({
    source: 'movie-search', 
    query: { movieQuery: 'Jurassic' }, 
    filter: '{ totalResults Search { Title Year Poster } }',
    transform (data) {
      // Check if data is being returned
      if(data && data.Search)
        return { list: [...data.Search] };

      // Otherwise just keep the current list of movies
      else
        return movies;
    }
  })
...
  • Guest
  • Nov 26 2019
  • Already exists