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
cb9f4636
Commit
cb9f4636
authored
May 11, 2021
by
Xiyang Lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve pull conflict
parent
b2672ad5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
6 deletions
+57
-6
OrdersController.java
...va/com/nisum/ecomservice/controller/OrdersController.java
+0
-2
cart_actions.js
ecom-web/src/actions/cart_actions.js
+15
-0
session.jsx
ecom-web/src/components/session/session.jsx
+0
-4
cart_reducer.js
ecom-web/src/reducers/cart_reducer.js
+29
-0
cart_api_util.js
ecom-web/src/util/cart_api_util.js
+13
-0
No files found.
ecom-service/src/main/java/com/nisum/ecomservice/controller/OrdersController.java
View file @
cb9f4636
...
...
@@ -18,6 +18,4 @@ public class OrdersController {
private
Mono
<
Order
>
postOrder
(
@RequestBody
OrderRequest
orderRequest
){
return
orderService
.
postOrder
(
orderRequest
);
}
}
ecom-web/src/actions/cart_actions.js
0 → 100644
View file @
cb9f4636
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
})
ecom-web/src/components/session/session.jsx
View file @
cb9f4636
...
...
@@ -16,10 +16,6 @@ export default class Session extends Component {
this
.
logOutSuccess
=
this
.
logOutSuccess
.
bind
(
this
)
}
// componentDidMount(){
// this.props.logOut()
// }
loginSuccess
=
(
response
)
=>
{
const
{
accessToken
,
tokenId
,
googleId
:
userId
,
profileObj
}
=
response
const
{
email
,
familyName
:
lastName
,
givenName
:
firstName
}
=
profileObj
...
...
ecom-web/src/reducers/cart_reducer.js
0 → 100644
View file @
cb9f4636
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
;
ecom-web/src/util/cart_api_util.js
0 → 100644
View file @
cb9f4636
import
axios
from
'axios'
;
export
const
postCart
=
(
data
)
=>
{
return
axios
.
post
(
"http://localhost:8080/api/carts"
,
data
)
}
export
const
getCartById
=
(
id
)
=>
{
return
axios
.
get
(
"http://localhost:8080/api/carts"
,
{
params
:
{
userId
:
id
}
})
}
\ No newline at end of file
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