aboutsummaryrefslogtreecommitdiff
path: root/src/store/reducers
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/reducers')
-rw-r--r--src/store/reducers/userMomentsReducer.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/store/reducers/userMomentsReducer.ts b/src/store/reducers/userMomentsReducer.ts
index 456ca2fa..97c9a1fd 100644
--- a/src/store/reducers/userMomentsReducer.ts
+++ b/src/store/reducers/userMomentsReducer.ts
@@ -8,8 +8,18 @@ const userMomentsSlice = createSlice({
userMomentsFetched: (state, action) => {
state.moments = action.payload;
},
+
+ momentCategoryDeleted: (state, action) => {
+ const category = action.payload;
+ state.moments = state.moments.filter(
+ (moment) => moment.moment_category !== category,
+ );
+ },
},
});
-export const {userMomentsFetched} = userMomentsSlice.actions;
+export const {
+ userMomentsFetched,
+ momentCategoryDeleted,
+} = userMomentsSlice.actions;
export const userMomentsReducer = userMomentsSlice.reducer;