diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-01-31 16:30:13 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-01-31 16:30:13 +0700 |
| commit | ad46d122029999b7639657936068c4643f3572eb (patch) | |
| tree | 417aa969813fbd36ac6fac49b755ec642ce8c547 /src/pages | |
| parent | 49198fed8da2ab476bebc2233907063b02de0d66 (diff) | |
Product skeleton
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/index.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/pages/index.js b/src/pages/index.js index 8c636616..b233f81e 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -25,7 +25,6 @@ export async function getServerSideProps() { export default function Home({ heroBanners }) { const [manufactures, setManufactures] = useState(null); - const [readyStockProducts, setReadyStockProducts] = useState(null); const [popularProducts, setPopularProducts] = useState(null); const [categoryProducts, setCategoryProducts] = useState(null); @@ -35,12 +34,6 @@ export default function Home({ heroBanners }) { setManufactures(dataManufactures); } getManufactures(); - - const getReadyStockProducts = async () => { - const dataReadyStockProducts = await apiOdoo('GET', `/api/v1/product?ready_stock=1&limit=30`); - setReadyStockProducts(dataReadyStockProducts); - } - getReadyStockProducts(); const getPopularProducts = async () => { const dataPopularProducts = await axios(`${process.env.SELF_HOST}/api/shop/search?q=*&page=1&order_by=popular`); @@ -92,7 +85,13 @@ export default function Home({ heroBanners }) { { categoryProducts?.map((categoryProduct) => ( <div className="my-6 px-4 py-3 relative" key={categoryProduct.id}> <ProductSlider - products={categoryProduct} + products={categoryProduct ? { + products: categoryProduct.products, + banner: { + image: categoryProduct.image, + name: categoryProduct.name + } + } : null} bannerMode={true} /> </div> |
