Skip to content

Commit

Permalink
fix: add null check to category/subcategory pages (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
120EE0692 authored May 15, 2022
1 parent c002859 commit 48ed3fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/pages/[category]/[subCategory].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const CategoryPage = ({
} = await GraphClient.query({
query: getArticlesByCategories,
variables: {
categoryNumbers: [subCategoryDetails.idNumber],
categoryNumbers: [subCategoryDetails?.idNumber],
limit: 7,
offset: (pageNo - 1) * 7,
},
Expand All @@ -48,7 +48,7 @@ const CategoryPage = ({
})();
}
setLoading(false);
}, [pageNo, articleList, subCategoryDetails.idNumber]);
}, [pageNo, articleList, subCategoryDetails?.idNumber]);

const handleChange = (event, value) => {
setPageNo(value);
Expand Down

0 comments on commit 48ed3fd

Please sign in to comment.