if i have a page that fetch products and render products based on this data , and filter them as well like this
import GetCategory from "@/actions/get-category";
import GetColors from "@/actions/get-colors";
import GetSizes from "@/actions/get-sizes";
import Billboard from "@/components/billboard";
import Filter from "./components/filter";
import GetProducts from "@/actions/get-products";
import NoResult from "@/components/ui/noResult";
import ProductList from "@/components/ui/productList";
interface CategoryPageProps {
params: {
categoryId: string;
};
searchParams: {
colorId: string;
sizeId: string;
};
}
const CategoryPage: React.FC<CategoryPageProps> = async ({
params,
searchParams,
}) => {
const products = await GetProducts({
categoryId: params.categoryId,
sizeId: searchParams.sizeId,
colorId: searchParams.colorId,
});
console.log(products);
const sizes = await GetSizes();
const colors = await GetColors();
const category = await GetCategory(params.categoryId);
return (
<div className="bg-white">
<div className="space-y-4">
<Billboard data={category.billboard} />
<div className="px-4 sm:px-6 lg:px-8 pb-24">
<div className="lg:grid lg:grid-cols-5 lg:gap-x-8">
{/* MOBILE FILTER*/}
<div className="hidden lg:block">
<Filter data={sizes} name="Sizes" searchKey="sizeId" />
<Filter data={colors} name="Colors" searchKey="colorId" />
</div>
<div className="mt-6 lg:mt-0 lg:col-span-4">
{products.length === 0 ? (
<NoResult />
) : (
<ProductList title="T-Shirts" items={products} />
)}
</div>
</div>
</div>
</div>
</div>
);
};
export default CategoryPage;
when im not adding the
export const revalidate = 0
it only fetch some products and not others, why