General improvements to postlist and post

This commit is contained in:
riggraz
2019-09-21 11:17:58 +02:00
parent 38345f9c42
commit 7874015580
11 changed files with 25 additions and 13 deletions

View File

@@ -100,7 +100,6 @@ const commentsReducer = (
};
case COMMENT_SUBMIT_SUCCESS:
console.log(action.comment);
return {
...state,
items: [commentReducer(undefined, commentRequestSuccess(action.comment)), ...state.items],

View File

@@ -14,6 +14,7 @@ const initialState: IPost = {
description: null,
boardId: 0,
postStatusId: null,
commentsCount: 0,
userId: 0,
createdAt: '',
};
@@ -30,6 +31,7 @@ const postReducer = (
description: action.post.description,
boardId: action.post.board_id,
postStatusId: action.post.post_status_id,
commentsCount: action.post.comments_count,
userId: action.post.user_id,
createdAt: action.post.created_at,
};