Skip to content

Commit

Permalink
Changes to be committed:
Browse files Browse the repository at this point in the history
	modified:   client/src/pages/products/index.tsx
  • Loading branch information
Thith-thith committed Aug 7, 2023
1 parent e9a8d3a commit 8ae3a82
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions client/src/pages/products/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Component, For, Show, createResource } from "solid-js";
import Cards from "../../components/cards/Cards";
import CoreProducts from "../../data/Core-Product";

const Products: Component<{}> = () => {
const fetchData = async () => {
const res = await fetch("https://cptdb.koompi.com/CoreProducts");
return res.json();
};
// const fetchData = async () => {
// const res = await fetch("https://cptdb.koompi.com/CoreProducts");
// return res.json();
// };

const [allProducts] = createResource(fetchData);
// const [allProducts] = createResource(fetchData);

return (
<div class="mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl">
Expand Down Expand Up @@ -687,9 +688,9 @@ const Products: Component<{}> = () => {

<div class="lg:col-span-3">
<div class="grid md:grid-cols-3 gap-4 mt-4">
<For each={allProducts()}>
{(CoreProducts) => {
return <Cards product={CoreProducts} />;
<For each={CoreProducts}>
{(res) => {
return <Cards product={res} />;
}}
</For>
</div>
Expand Down

0 comments on commit 8ae3a82

Please sign in to comment.