mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Add select to change board of post
This commit is contained in:
@@ -5,6 +5,11 @@ import {
|
||||
POST_REQUEST_FAILURE,
|
||||
} from '../actions/requestPost';
|
||||
|
||||
import {
|
||||
ChangePostBoardSuccessAction,
|
||||
CHANGE_POST_BOARD_SUCCESS,
|
||||
} from '../actions/changePostBoard';
|
||||
|
||||
import {
|
||||
ChangePostStatusSuccessAction,
|
||||
CHANGE_POST_STATUS_SUCCESS,
|
||||
@@ -55,6 +60,7 @@ const currentPostReducer = (
|
||||
state = initialState,
|
||||
action:
|
||||
PostRequestActionTypes |
|
||||
ChangePostBoardSuccessAction |
|
||||
ChangePostStatusSuccessAction |
|
||||
CommentsRequestActionTypes |
|
||||
HandleCommentRepliesType |
|
||||
@@ -82,6 +88,7 @@ const currentPostReducer = (
|
||||
error: action.error,
|
||||
};
|
||||
|
||||
case CHANGE_POST_BOARD_SUCCESS:
|
||||
case CHANGE_POST_STATUS_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -2,6 +2,10 @@ import {
|
||||
POST_REQUEST_SUCCESS,
|
||||
} from '../actions/requestPost';
|
||||
|
||||
import {
|
||||
CHANGE_POST_BOARD_SUCCESS,
|
||||
} from '../actions/changePostBoard';
|
||||
|
||||
import {
|
||||
CHANGE_POST_STATUS_SUCCESS,
|
||||
} from '../actions/changePostStatus';
|
||||
@@ -36,6 +40,12 @@ const postReducer = (
|
||||
createdAt: action.post.created_at,
|
||||
};
|
||||
|
||||
case CHANGE_POST_BOARD_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
boardId: action.newBoardId,
|
||||
};
|
||||
|
||||
case CHANGE_POST_STATUS_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
|
||||
Reference in New Issue
Block a user