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
08831eb5
Commit
08831eb5
authored
May 11, 2021
by
Xiyang Lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve conflict
parent
e01ef5cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
50 deletions
+0
-50
cart_actions.js
ecom-web/src/actions/cart_actions.js
+0
-18
cart_reducer.js
ecom-web/src/reducers/cart_reducer.js
+0
-32
No files found.
ecom-web/src/actions/cart_actions.js
View file @
08831eb5
<<<<<<<
HEAD
import
{
postCart
}
from
'../util/cart_api_util'
export
const
ADD_NEW_CART
=
"ADD_NEW_CART"
export
const
RECEIVE_CART
=
"RECEIVE_CART"
export
const
addNewCart
=
cart
=>
({
type
:
ADD_NEW_CART
,
cart
})
export
const
receieveCart
=
cart
=>
({
type
:
RECEIVE_CART
,
cart
})
=======
import
*
as
ApiUtil
from
'../util/cart_api_util'
;
export
const
RECEIVE_USER_CART
=
"RECEIVE_USER_CART"
;
...
...
@@ -37,4 +20,3 @@ export const updateUserCart = (updatedCart, userEmail) => dispatch => ApiUtil.up
export
const
createUserCart
=
newCart
=>
dispatch
=>
ApiUtil
.
createCart
(
newCart
)
.
then
(
res
=>
res
.
json
)
>>>>>>>
1
f99e20fa13caaa629b4886d2be1b9d96bb9aa82
ecom-web/src/reducers/cart_reducer.js
View file @
08831eb5
<<<<<<<
HEAD
import
{
ADD_NEW_CART
,
RECEIVE_CART
}
from
'../actions/cart_actions'
const
initialState
=
{
user
:
null
,
cartItems
:
[]
}
const
cartReducer
=
(
prevState
=
initialState
,
action
)
=>
{
Object
.
freeze
(
prevState
);
const
nextState
=
{...
prevState
};
switch
(
action
.
type
)
{
case
RECEIVE_CART
:
nextState
.
user
=
"user"
nextState
.
cartItems
=
[
"dafsd"
,
"fasdfa"
]
return
nextState
;
case
ADD_NEW_CART
:
nextState
.
user
=
"action.products.data"
nextState
.
cartItems
=
[]
return
nextState
;
default
:
return
nextState
;
}
}
export
default
cartReducer
;
=======
import
{
RECEIVE_USER_CART
,
CLEAR_USER_CART
}
from
'../actions/cart_actions'
;
const
initialState
=
[]
...
...
@@ -47,4 +16,3 @@ const cartReducer = (state = initialState, action) => {
}
export
default
cartReducer
;
>>>>>>>
1
f99e20fa13caaa629b4886d2be1b9d96bb9aa82
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