Rename getRandomElement function to getRandomItem

This commit is contained in:
2022-06-13 15:26:53 +02:00
parent 622e304efa
commit cfd6173baf
3 changed files with 5 additions and 5 deletions

View File

@@ -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)