Skip to content

Commit

Permalink
Feat: 학기 필터링 상태 Reducer에 추가(#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohinhyuk committed Aug 25, 2023
1 parent ab72cb6 commit 5a7d438
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/redux/slices/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';

const initialState = {
category: '',
semester: '',
};

const slice = createSlice({
Expand All @@ -12,7 +13,13 @@ const slice = createSlice({
state.category = action.payload;
},
clearCategory: (state) => {
state.category = '';
state.category = undefined;
},
setSemester: (state, action) => {
state.semester = action.payload;
},
clearSemester: (state) => {
state.semester = undefined;
},
},
});
Expand Down

0 comments on commit 5a7d438

Please sign in to comment.