Browse Source

참여 그룹 목록(데이터 안뜨는 현상 해결)

pull/2/head
sanguu 2 years ago
parent
commit
ca49af45a3
  1. 26
      src/modules/basis/group/reducers/basisGroupReducer.ts
  2. 5
      src/modules/basis/group/sagas/basisGroupSaga.ts

26
src/modules/basis/group/reducers/basisGroupReducer.ts

@ -19,10 +19,10 @@ export const groupReducer = createReducer<GroupState, Actions.GroupAction>(
const { data, count } = action.payload;
const agreeList = data.filter(res => {
if(res.aprvlYn === 'Y') {
if (res.aprvlYn === 'Y') {
return res;
}
})
});
draft.joinList = agreeList;
draft.joinListCount = agreeList.length;
@ -34,20 +34,18 @@ export const groupReducer = createReducer<GroupState, Actions.GroupAction>(
produce(state, draft => {
const { data, count } = action.payload;
console.log(data);
// const agreeList = data.filter(res => {
// if (res.aprvlYn === 'Y') {
// return res;
// }
// });
// draft.mainList = agreeList;
// draft.mainListCount = agreeList.length;
const agreeList = data.filter(res => {
if(res.aprvlYn === 'Y') {
return res;
}
draft.mainList = data;
draft.mainListCount = count;
})
draft.mainList = agreeList;
draft.mainListCount = agreeList.length;
// draft.mainList = data;
// draft.mainListCount = count;
})
)
)
.handleAction(Actions.GROUP_MYLIST.success, (state, action) =>
produce(state, draft => {
const { data, count } = action.payload;

5
src/modules/basis/group/sagas/basisGroupSaga.ts

@ -90,6 +90,7 @@ function* GrouplistSaga(
const { data, count, errorCode, errorMessage } = res;
if (errorCode) {
// 오류메시지 호출
debugger;
yield put(
MessageActions.IS_ERROR({
errorCode: errorCode,
@ -103,13 +104,13 @@ function* GrouplistSaga(
}
yield put(
Actions.JOIN_LIST.success({
Actions.GROUP_MAIN_LIST.success({
data: data,
count: count
})
);
} catch (error) {
yield put(Actions.JOIN_LIST.failure(error));
yield put(Actions.GROUP_MAIN_LIST.failure(error));
}
}
function* myJoinSaga(action: ActionType<typeof Actions.GROUP_MYLIST.request>) {

Loading…
Cancel
Save