diff --git a/pages/tout-savoir.tsx b/pages/tout-savoir.tsx index da818f1..d8b2c1f 100644 --- a/pages/tout-savoir.tsx +++ b/pages/tout-savoir.tsx @@ -5,11 +5,34 @@ import style from '../styles/ToutSavoir.module.css' import test from '../public/images/coffret-the-PhotoRoom.webp'; +import prisma from "../lib/prisma"; -const ToutSavoir = () => { +export async function getStaticProps() { + const produits = await prisma.produit.findMany(); + + return { + props: { + produits, + }, + } +} + +type Props = { + produits: Produit[]; +} + +type Produit = { + id: number; + actif: boolean; + nomProduit: string; + prixTtc: number; +} + +const ToutSavoir = ({ produits }: Props) => { + console.log('p', produits); return ( - <> + <> Tout savoir @@ -21,73 +44,33 @@ const ToutSavoir = () => { - {/* backgroundImagePath={'/images/ugh.png'} */} -
-

Tout savoir sur le jeu concours

-
-

- Le jeu concours vous est proposé à l'occasion de ... -

-
-
-
- produit -
-
Card title
-

Some quick example text to build on the card title and make up the bulk of the card's content.

-
-
-
-
-
- produit -
-
Card title
-

Some quick example text to build on the card title and make up the bulk of the card's content.

-
-
-
-
-
- produit -
-
Card title
-

Some quick example text to build on the card title and make up the bulk of the card's content.

-
-
-
-
-
+ {/* backgroundImagePath={'/images/ugh.png'} */} +
+

Tout savoir sur le jeu concours

+
+

+ Le jeu concours vous est proposé à l'occasion de ... +

+
+ {produits.map((produit: Produit) => { + return
+
produit
-
Card title
+
{produit.nomProduit}

Some quick example text to build on the card title and make up the bulk of the card's content.

-
+ })}
+
); }; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 279d769..a0b2ccb 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -93,7 +93,7 @@ model Produit { id Int @id @default(autoincrement()) actif Boolean? nomProduit String? - prixTtc Decimal? + prixTtc Int? refGain Gain[] }