diff --git a/src/redux/features/gamesSlice.tsx b/src/redux/features/gamesSlice.tsx index 058e48ea..a29ce7cd 100644 --- a/src/redux/features/gamesSlice.tsx +++ b/src/redux/features/gamesSlice.tsx @@ -45,7 +45,7 @@ const gamesSlice = createSlice({ reducers: { filteringByGenre(state : GamesState, action: PayloadAction) { // If empty, remove filter - if not, add it - let newFilters = state.activeFilters.filter(s => s.key !== "selected_genres"); + let newFilters = state.activeFilters.filter(s => s.key !== "selected_genres") as gamesFilters; if (action.payload.length !== 0) { newFilters.push({ key: "selected_genres", @@ -56,7 +56,7 @@ const gamesSlice = createSlice({ }, filterByTitle(state : GamesState, action: PayloadAction) { // If empty, remove filter - if not, add it - let newFilters = state.activeFilters.filter(s => s.key !== "selected_title"); + let newFilters = state.activeFilters.filter(s => s.key !== "selected_title") as gamesFilters; if (action.payload.length !== 0) { newFilters.push({ key: "selected_title", @@ -67,7 +67,7 @@ const gamesSlice = createSlice({ }, filterByPlatform(state : GamesState, action: PayloadAction) { // If empty, remove filter - if not, add it - let newFilters = state.activeFilters.filter(s => s.key !== "selected_platform"); + let newFilters = state.activeFilters.filter(s => s.key !== "selected_platform") as gamesFilters; if (action.payload.length !== 0) { newFilters.push({ key: "selected_platform", @@ -129,4 +129,4 @@ export const selectSelectedTitle = createSelector( // Action creators are generated for each case reducer function export const { filteringByGenre, filterByTitle, filterByPlatform } = gamesSlice.actions; -export default gamesSlice.reducer; \ No newline at end of file +export default gamesSlice.reducer;