From 17a62a4165193c8ff4c1cfef65d7133db83e0e3d Mon Sep 17 00:00:00 2001 From: saseungmin Date: Sat, 19 Dec 2020 13:57:11 +0900 Subject: [PATCH] [Fix] Delete and load study list - Fixed an error in loading the study list after deleting a study article --- src/reducers/groupSlice.js | 4 +++- src/reducers/groupSlice.test.js | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/reducers/groupSlice.js b/src/reducers/groupSlice.js index 23ddd28..ebf38b3 100644 --- a/src/reducers/groupSlice.js +++ b/src/reducers/groupSlice.js @@ -205,8 +205,10 @@ export const updateConfirmParticipant = (userEmail) => async (dispatch, getState })); }; -export const deleteGroup = (groupId) => async () => { +export const deleteGroup = (groupId) => async (dispatch) => { await deletePostGroup(groupId); + + dispatch(loadStudyGroups()); }; export default reducer; diff --git a/src/reducers/groupSlice.test.js b/src/reducers/groupSlice.test.js index f19681b..f22c4bc 100644 --- a/src/reducers/groupSlice.test.js +++ b/src/reducers/groupSlice.test.js @@ -382,7 +382,12 @@ describe('async actions', () => { const actions = store.getActions(); - expect(actions[0]).toEqual(); + expect(actions[0]).toEqual( + { + payload: [], + type: 'group/setStudyGroups', + }, + ); }); }); });