diff --git a/api/src/api/product/content-types/product/schema.json b/api/src/api/product/content-types/product/schema.json index cda87a7..e27e61b 100644 --- a/api/src/api/product/content-types/product/schema.json +++ b/api/src/api/product/content-types/product/schema.json @@ -18,7 +18,7 @@ "desc": { "type": "text" }, - "Image": { + "image": { "type": "media", "multiple": false, "required": false, @@ -29,7 +29,7 @@ "audios" ] }, - "Image2": { + "image2": { "type": "media", "multiple": false, "required": false, diff --git a/api/types/generated/contentTypes.d.ts b/api/types/generated/contentTypes.d.ts index e3e8db0..c1e94f7 100644 --- a/api/types/generated/contentTypes.d.ts +++ b/api/types/generated/contentTypes.d.ts @@ -486,8 +486,8 @@ export interface ApiProductProduct extends Struct.CollectionTypeSchema { createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; desc: Schema.Attribute.Text; - Image: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; - Image2: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; + image: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; + image2: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; isNew: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo; locale: Schema.Attribute.String & Schema.Attribute.Private; localizations: Schema.Attribute.Relation< diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index bf65327..026c61b 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -6,17 +6,11 @@ const nextConfig = { source: '/backend/:path*', destination: `http://192.168.50.107:5580/:path*`, }, - ] - }, - images: { - remotePatterns: [ { - protocol: "https", - hostname: "ih1.redbubble.net", - port: "", - pathname: "/**", - }, - ], + source: '/strapi/:path*', + destination: `http://192.168.50.107:1337/:path*`, + } + ] }, }; diff --git a/frontend/src/app/products/page.tsx b/frontend/src/app/products/page.tsx index 90b83c1..cdd562e 100644 --- a/frontend/src/app/products/page.tsx +++ b/frontend/src/app/products/page.tsx @@ -11,16 +11,21 @@ const Products = () => { const [maxPrice, setMaxPrice] = useState(100); const [sort, setSort] = useState("asc"); - async function getData () { - let response = await fetch(process.env.REACT_APP_API_URL + "/products", { + async function GetData () { + // const response = await fetch("/strapi/products?=populate=*", { + const response = await fetch(process.env.NEXT_PUBLIC_API_URL +"/products?populate=*", { method: "GET", headers: { - Authorization: "bearer" + process.env.REACT_APP_API_TOKEN, - }, + Authorization: "Bearer " + process.env.NEXT_PUBLIC_API_TOKEN + } }); - let data = await response.json(); - console.log(data); + const data = await response.json(); + // console.log(data.data); + // console.log(data.data[0].image.url); + return data.data; }; + const products = GetData(); + console.log(products); return (
@@ -75,7 +80,8 @@ const Products = () => { alt="Profile picture" /> */}
- + + {/* */} ); }; diff --git a/frontend/src/components/ui/MenuCard/MenuCard.tsx b/frontend/src/components/ui/MenuCard/MenuCard.tsx index 3d55dba..cd13f89 100644 --- a/frontend/src/components/ui/MenuCard/MenuCard.tsx +++ b/frontend/src/components/ui/MenuCard/MenuCard.tsx @@ -20,8 +20,10 @@ const Popp = Poppins({ weight: "400", subsets: ["latin"] }); // }); // const inter = Inter({ subsets: ["latin"] }); + const MenuCard = ({ Menu }: any) => { const router = useRouter(); + return (
{Menu.map((menu_item: any) => { @@ -33,7 +35,7 @@ const MenuCard = ({ Menu }: any) => {