Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ export async function addProductToOrder(orderId, productId, price, quantity) {
};
try {
const { data } = await axios.post(`/api/orders/${orderId}/products`, bodyParameters);
console.log("addProductToOrder", data)
return data;
} catch (error) {
throw error;
Expand Down Expand Up @@ -141,7 +140,6 @@ export async function createProduct(name, description, price, inStock, imageURL,
export async function destroyProduct(id) {
try {
const {data} = await axios.delete(`/api/products/${id}`)
console.log('The result of deleting:', data)
return data
} catch (error) {
throw error;
Expand Down
1 change: 0 additions & 1 deletion src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { Elements } from "@stripe/react-stripe-js";

const App = () => {
const [fetchId, setFetchId] = useState(null)
console.log("Here is the result of fetchId:", fetchId);
const [ orders, setOrders ] = useState(getCurrentCart());
const [ token, setToken ] = useState(getCurrentToken());
const [ user, setUser ] = useState(getCurrentUser())
Expand Down
3 changes: 0 additions & 3 deletions src/components/Board.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const MainBoard = (props) => {
async function fetchProducts(){
try{
const data = await getAllProducts()
console.log('data array ', data)
console.log('category ', categorysel)
setProductRender(data)
setFetchId(selectedId)
}catch(error){
Expand All @@ -34,7 +32,6 @@ const MainBoard = (props) => {
useEffect(() => {
fetchProducts()
},[]);
console.log('set render ',productRender)

return <><div style={{display: 'flex', justifyContent: 'space-between', flexDirection: 'column'}}>
{user && user.isadmin ? <Button onClick={() => {setAdminToggle(!adminToggle)}} style={{margin:'.4rem'}} variant="primary" size="lg" block>
Expand Down
3 changes: 3 additions & 0 deletions src/components/Cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ const Cart = (props) => {
}
setTotal(newTotal)
}
if(!orders){
setOrders([])
}
}catch(error){
console.error(error)
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const HomePage = (props) => {
async function fetchProducts(){
try{
const data = await getAllProducts()
console.log('data array ', data)
setProductRender(data)
setFetchId(selectedId)
}catch(error){
Expand All @@ -24,7 +23,6 @@ const HomePage = (props) => {
}
fetchProducts()
},[selectedId]);
console.log('set render ',productRender)

return <div>
<div>
Expand Down
3 changes: 0 additions & 3 deletions src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const Navigation = (props) => {
clearCurrentToken();
clearCurrentCart();
setOrders([])
console.log("See Ya!", "You Have Succesfully Logged Out!", "success");
setUser({});
setToken('');
history.push('/users/login');
Expand All @@ -46,8 +45,6 @@ const Navigation = (props) => {
}
}, []);

{console.log("this is the user:", user)}

return <div><Navbar collapseOnSelect expand="lg" bg="dark" variant="dark">
<NavLink to="/home">
<Navbar.Brand>Codalorians</Navbar.Brand>
Expand Down
1 change: 0 additions & 1 deletion src/components/ProductCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const Prod = (props) => {
setQuantity(1)
const productOrder = await addProductToOrder(orderId, id, price, quantity)
} else if(!loggedIn){
console.log('we good')
const grabbedCart = getCurrentCart();
const grabbedProduct = await getProductById(id)
grabbedCart.push(grabbedProduct)
Expand Down