mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 19:51:23 +00:00
bug: fix show featured blogs
This commit is contained in:
@@ -22,7 +22,12 @@ const BlogsList = ({ blogList,total,idFeatured }:BlogsListProps) => {
|
||||
const DEFAULT_BLOGS_ARGS = {
|
||||
excludeBlogIds: [idFeatured],
|
||||
options:{
|
||||
skip: 1, take: DEFAULT_BLOG_PAGE_SIZE
|
||||
take: DEFAULT_BLOG_PAGE_SIZE,
|
||||
filter: {
|
||||
isFeatured: {
|
||||
eq:false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +39,7 @@ const BlogsList = ({ blogList,total,idFeatured }:BlogsListProps) => {
|
||||
|
||||
|
||||
|
||||
|
||||
const onPageChange = (page:number) => {
|
||||
router.push({
|
||||
pathname: ROUTE.BLOGS,
|
||||
@@ -65,7 +71,6 @@ const BlogsList = ({ blogList,total,idFeatured }:BlogsListProps) => {
|
||||
data = blogs
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<section>
|
||||
<div className={s.wrapper}>
|
||||
@@ -73,10 +78,10 @@ const BlogsList = ({ blogList,total,idFeatured }:BlogsListProps) => {
|
||||
<div className={s.list}>
|
||||
|
||||
{
|
||||
data?.map((product,index)=> {
|
||||
data?.map((blog,index)=> {
|
||||
return(
|
||||
<div className={s.card} key={`${product.title}-${index}`}>
|
||||
{product.isPublish && <CardBlog {...product} /> }
|
||||
<div className={s.card} key={`${blog.title}-${index}`}>
|
||||
{blog.isPublish && !blog.isFeatured && <CardBlog {...blog} /> }
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
Reference in New Issue
Block a user