Rename getRandomElement function to getRandomItem
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit'
|
||||
import { fetchAPI } from '$utils/api'
|
||||
import { getRandomElement } from '$utils/functions'
|
||||
import { getRandomItem } from '$utils/functions'
|
||||
import { getProduct } from '$utils/functions/swell'
|
||||
|
||||
export async function get({}: RequestEvent): Promise<RequestHandlerOutput> {
|
||||
@@ -37,7 +37,7 @@ export async function get({}: RequestEvent): Promise<RequestHandlerOutput> {
|
||||
`)
|
||||
|
||||
if (data) {
|
||||
const randomPoster = getRandomElement(data.data.posters)
|
||||
const randomPoster = getRandomItem(data.data.posters)
|
||||
|
||||
// Fetch Swell API for product
|
||||
const shopProduct = await getProduct(randomPoster.product_id)
|
||||
|
||||
Reference in New Issue
Block a user