Fix getRandomElement function
Now return an array item instead of an index
This commit is contained in:
@@ -221,7 +221,7 @@
|
||||
*/
|
||||
const productAPI = (!page.params.type && !page.params.name)
|
||||
// Get a random product
|
||||
? data.posters[getRandomElement(data.posters)]
|
||||
? getRandomElement(data.posters)
|
||||
// Get the current product from slug
|
||||
: data.posters.find(({ location }: any) => location.slug === page.params.name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user