File tree Expand file tree Collapse file tree 2 files changed +1
-3
lines changed
Expand file tree Collapse file tree 2 files changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,6 @@ const CategoryPage = ({ posts, tags }) => {
2121CategoryPage . getInitialProps = async ( { req } ) => {
2222 const url = req . originalUrl . split ( "/" ) [ 2 ] ;
2323 const category_id = url == "all" ? "" : url . split ( "-" ) [ 0 ] ;
24- // const postsRes = await getPosts({ category_id });
25- // const tagsRes = await getMetas("tags");
2624
2725 let [ respPosts , respTags ] = await Promise . all ( [ getPosts ( { category_id } ) , getMetas ( "tags" ) ] ) ;
2826 let posts = respPosts . status == 200 ? [ ...respPosts . data ] : [ ] ;
@@ -32,6 +30,7 @@ CategoryPage.getInitialProps = async ({ req }) => {
3230 tags [ tag . id ] = tag . slug ;
3331 }
3432 }
33+
3534 return { posts, tags } ;
3635} ;
3736
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { ACTIONS } from "src/utils/consts";
22
33const PostReducer = ( state , action ) => {
44 const { type, val } = action ;
5-
65 switch ( type ) {
76 case ACTIONS . INIT_POSTS :
87 return { ...val } ;
You can’t perform that action at this time.
0 commit comments