Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ecommerce-maven
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
ecommerce-maven
Commits
b9273ddd
Commit
b9273ddd
authored
May 12, 2021
by
Christopher Cottier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user cannot access cart if not logged in
parent
6994d175
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
20465 deletions
+27
-20465
package-lock.json
ecom-web/package-lock.json
+24
-20463
shopping-cart.js
ecom-web/src/components/shopping-cart/shopping-cart.js
+3
-2
No files found.
ecom-web/package-lock.json
View file @
b9273ddd
This diff is collapsed.
Click to expand it.
ecom-web/src/components/shopping-cart/shopping-cart.js
View file @
b9273ddd
...
...
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
import
CartItem
from
'./CartItem.js'
import
'./shopping-cart.css'
import
{
useSelector
,
useDispatch
}
from
'react-redux'
import
{
Link
}
from
'react-router-dom'
import
{
Link
,
Redirect
}
from
'react-router-dom'
import
{
updateUserCart
}
from
'./../../actions/cart_actions'
...
...
@@ -74,7 +74,7 @@ export default function ShoppingCart() {
// Sync Cart with backend and redux global state
////////////////////////////////////////////////////////////////
useEffect
(()
=>
{
if
(
!
userSession
)
return
;
const
cartUpdateObj
=
{
userId
:
userSession
.
email
,
cartItems
:
cartRefs
...
...
@@ -85,6 +85,7 @@ export default function ShoppingCart() {
},
[
cartItems
])
if
(
!
userSession
)
return
<
Redirect
to
=
"/product-market"
/>
return
(
<
div
id
=
"shoppingCartContainer"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment