group posts
This commit is contained in:
@@ -215,7 +215,17 @@ export const deletePost = createAsyncThunk(
|
||||
const postsSlice = createSlice({
|
||||
name: 'posts',
|
||||
initialState,
|
||||
reducers: {},
|
||||
reducers: {
|
||||
setGroupFeedStatus: (
|
||||
state,
|
||||
action: PayloadAction<{ key: keyof PostsState; status: Status }>,
|
||||
) => {
|
||||
const { key, status } = action.payload;
|
||||
if (state[key]) {
|
||||
(state[key] as any).status = status;
|
||||
}
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
// fetchGroupPosts
|
||||
builder.addCase(fetchGroupPosts.pending, (state) => {
|
||||
@@ -333,4 +343,5 @@ const postsSlice = createSlice({
|
||||
},
|
||||
});
|
||||
|
||||
export const { setGroupFeedStatus } = postsSlice.actions;
|
||||
export const groupFeedReducer = postsSlice.reducer;
|
||||
|
||||
Reference in New Issue
Block a user