From 21a2754fc9fc25f25987499c68d98662955253bc Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Sat, 21 Sep 2024 14:47:22 +0100 Subject: [PATCH] blog id added --- src/components/Blogs/index.jsx | 2 +- src/components/Dashboards/AccountDashboard.jsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Blogs/index.jsx b/src/components/Blogs/index.jsx index 78fa4ef..a9e68bb 100644 --- a/src/components/Blogs/index.jsx +++ b/src/components/Blogs/index.jsx @@ -28,7 +28,7 @@ export default function BlogItem(props) { useEffect(()=>{ if(!blog_id){ - navigate('/',{replace:true}) + return navigate('/',{replace:true}) } apiCall.getSingleBlogData({blog_id}).then(res => { setBlogdata({loading: false, data:res.data}) diff --git a/src/components/Dashboards/AccountDashboard.jsx b/src/components/Dashboards/AccountDashboard.jsx index 325dcb4..4cd6187 100644 --- a/src/components/Dashboards/AccountDashboard.jsx +++ b/src/components/Dashboards/AccountDashboard.jsx @@ -24,7 +24,7 @@ const AccountDashboard = ({ className, bannerList }) => { {getUpperBanner?.map((props, idx) => { let image = getImage(props); - let { short_title, short_description, short_button_text, link_path } = + let { short_title, short_description, short_button_text, link_path, card_type, blog_id } = props; return ( @@ -34,7 +34,7 @@ const AccountDashboard = ({ className, bannerList }) => { image={image} title={short_title} desc={short_description} - link_path={link_path} + link_path={card_type=='BLOG' ? `${link_path}?blog_id=${blog_id}` : link_path} /> );