diff --git a/erd-stuff.txt b/erd-stuff.txt new file mode 100644 index 0000000..5b89508 --- /dev/null +++ b/erd-stuff.txt @@ -0,0 +1,6 @@ +lastPurchaseID integer + locationIDLastPurchasedFrom integer + mostPurchasedLocationID integer + productTypesLastPurchased integer + productsIDLastPurchased integer + productsMostPurchasedID integer diff --git a/src/componets/KandyKorner.js b/src/componets/KandyKorner.js index 20243f8..da91645 100644 --- a/src/componets/KandyKorner.js +++ b/src/componets/KandyKorner.js @@ -1,4 +1,5 @@ import { LocationsList } from "./locations/Locations" +import { ProductList } from "./products/Products" export const KandyKorner = () => { return( @@ -6,6 +7,8 @@ export const KandyKorner = () => {
{locationObject.name}
+ } + ) + + } + > + ) + } \ No newline at end of file diff --git a/src/componets/locations/locations.css b/src/componets/locations/locations.css new file mode 100644 index 0000000..e69de29 diff --git a/src/componets/nav/navbar.css b/src/componets/nav/navbar.css new file mode 100644 index 0000000..e69de29 diff --git a/src/componets/nav/navbar.js b/src/componets/nav/navbar.js new file mode 100644 index 0000000..e69de29 diff --git a/src/componets/products/ProductTypes.js b/src/componets/products/ProductTypes.js new file mode 100644 index 0000000..e69de29 diff --git a/src/componets/products/Products.js b/src/componets/products/Products.js new file mode 100644 index 0000000..569ec49 --- /dev/null +++ b/src/componets/products/Products.js @@ -0,0 +1,29 @@ +import React, {useEffect,useState} from "react"; + +export const ProductList = () => { + const [products, setProductList] = useState([]) + const [totalProducts, totalProductAmounts] = useState("") + + useEffect( + () => { + // table call must be singular in the fetch link in order to properly retrieve objects + fetch("http://localhost:8088/products?_expand=productType&_sort=productTypeId&_order=asc") + .then(res => res.json()) + .then(setProductList) + }, + [] + ) + return ( + <> +{productObject.candyName} - Price - ${productObject.price} - Candy Type - {productObject.productType.candyType}
; + } + ) + + } + > + ) + } \ No newline at end of file