added file structure and components

This commit is contained in:
2021-11-23 13:34:24 -06:00
parent 5eb6f6d842
commit f23b837413
13 changed files with 36 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
lastPurchaseID integer
locationIDLastPurchasedFrom integer
mostPurchasedLocationID integer
productTypesLastPurchased integer
productsIDLastPurchased integer
productsMostPurchasedID integer
View File
View File
View File
+30
View File
@@ -0,0 +1,30 @@
import React, {
useEffect,
useState
} from "react";
export const LocationsList = () => {
const [locations, setLocationList] = useState([])
useEffect(
() => {
fetch("http://localhost:8088/locations")
.then(res => res.json())
.then(setLocationList)
},
[]
)
return (
<>
{
locations.map(
(locationObject) => {
return <p key={`locations--${locationObject.id}`}> {locationObject.name}</p>
}
)
}
</>
)
}
View File
View File
View File