refactor: centralize bundle filtering with filterOutBundles helper
Some checks failed
Build and Deploy / build (push) Has been cancelled
Some checks failed
Build and Deploy / build (push) Has been cancelled
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getProducts } from "@/lib/saleor";
|
||||
import { getProducts, filterOutBundles } from "@/lib/saleor";
|
||||
import { getTranslations, setRequestLocale } from "next-intl/server";
|
||||
import Header from "@/components/layout/Header";
|
||||
import Footer from "@/components/layout/Footer";
|
||||
@@ -29,9 +29,7 @@ export default async function ProductsPage({ params }: ProductsPageProps) {
|
||||
const saleorLocale = getSaleorLocale(validLocale as Locale);
|
||||
const allProducts = await getProducts(saleorLocale);
|
||||
|
||||
const products = allProducts.filter((product) => {
|
||||
return !product.name.includes("2x Set") && !product.name.includes("3x Set");
|
||||
});
|
||||
const products = filterOutBundles(allProducts);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user