Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
medmin committed Oct 19, 2019
1 parent f413d30 commit 2779763
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions pages/category/[cid].js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const CategoryPage = ({ posts, tags }) => {
CategoryPage.getInitialProps = async ({ req }) => {
const url = req.originalUrl.split("/")[2];
const category_id = url == "all" ? "" : url.split("-")[0];
// const postsRes = await getPosts({ category_id });
// const tagsRes = await getMetas("tags");

let [respPosts, respTags] = await Promise.all([getPosts({ category_id }), getMetas("tags")]);
let posts = respPosts.status == 200 ? [...respPosts.data] : [];
Expand All @@ -32,6 +30,7 @@ CategoryPage.getInitialProps = async ({ req }) => {
tags[tag.id] = tag.slug;
}
}

return { posts, tags };
};

Expand Down
1 change: 0 additions & 1 deletion src/reducers/PostReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ACTIONS } from "src/utils/consts";

const PostReducer = (state, action) => {
const { type, val } = action;

switch (type) {
case ACTIONS.INIT_POSTS:
return { ...val };
Expand Down

0 comments on commit 2779763

Please sign in to comment.