File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
web_panel/src/redux/actions Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import axios from "axios";
2
2
import { toast } from "react-toastify" ;
3
3
import { ToastObjects } from "../../util/toastObject" ;
4
4
import { UserConstants } from "../constants" ;
5
+ import { ActionTypes } from "../constants" ;
5
6
6
7
const {
7
8
USER_LIST_RESET ,
@@ -15,6 +16,12 @@ const {
15
16
USER_LOGOUT ,
16
17
} = UserConstants ;
17
18
19
+ const {
20
+ CLEAR_CART_ITEM ,
21
+ CART_REMOVE_SHIPPING_ADDRESS
22
+ } = ActionTypes ;
23
+
24
+
18
25
// Register
19
26
export const Register = ( name , email , password ) => async ( dispatch ) => {
20
27
@@ -107,5 +114,9 @@ export const Login = (email, password) => async (dispatch) => {
107
114
// Logout
108
115
export const logout = ( ) => ( dispatch ) => {
109
116
localStorage . removeItem ( "userPanelInfo" ) ;
117
+ localStorage . removeItem ( "shippingAddress" ) ;
118
+ localStorage . removeItem ( "cartItems" ) ;
110
119
dispatch ( { type : USER_LOGOUT } ) ;
120
+ dispatch ( { type : CLEAR_CART_ITEM } ) ;
121
+ dispatch ( { type : CART_REMOVE_SHIPPING_ADDRESS } ) ;
111
122
} ;
You can’t perform that action at this time.
0 commit comments