|
|
@ -12,6 +12,7 @@ import { |
|
|
|
logout, |
|
|
|
logout, |
|
|
|
refresh, |
|
|
|
refresh, |
|
|
|
pwUpdateAction, |
|
|
|
pwUpdateAction, |
|
|
|
|
|
|
|
userDeleteAction |
|
|
|
} from '../actions/authAction'; |
|
|
|
} from '../actions/authAction'; |
|
|
|
|
|
|
|
|
|
|
|
import { UserPageState, UserPageData, initResponseUserPageData,UserPwState,UserData,UserPw,initResponseUserPwPageData,} from '../models/authModel'; |
|
|
|
import { UserPageState, UserPageData, initResponseUserPageData,UserPwState,UserData,UserPw,initResponseUserPwPageData,} from '../models/authModel'; |
|
|
@ -23,6 +24,7 @@ export interface AuthState { |
|
|
|
message: string; |
|
|
|
message: string; |
|
|
|
user?: UserData; |
|
|
|
user?: UserData; |
|
|
|
UserPw?: UserPw; |
|
|
|
UserPw?: UserPw; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// reducers
|
|
|
|
// reducers
|
|
|
@ -78,8 +80,13 @@ export const authReducer = createReducer<AuthState, AuthAction>(initialState) |
|
|
|
draft.isLogin = false; |
|
|
|
draft.isLogin = false; |
|
|
|
draft.user = undefined; |
|
|
|
draft.user = undefined; |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
.handleAction(userDeleteAction.success, state => |
|
|
|
|
|
|
|
produce(state, draft => { |
|
|
|
|
|
|
|
draft.isLogin = false; |
|
|
|
|
|
|
|
draft.user = undefined; |
|
|
|
|
|
|
|
}) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
export const mypageReducer = createReducer<UserPageState, AuthAction>(initResponseUserPageData).handleAction(userPageAction.success, (state, action) => |
|
|
|
export const mypageReducer = createReducer<UserPageState, AuthAction>(initResponseUserPageData).handleAction(userPageAction.success, (state, action) => |
|
|
|
produce(state, draft => { |
|
|
|
produce(state, draft => { |
|
|
|
const data: UserPageData = action.payload; |
|
|
|
const data: UserPageData = action.payload; |
|
|
|