From f7dac7bebd521a22d38fd3155eb708b0ed41aba1 Mon Sep 17 00:00:00 2001 From: Shivam Gaur Date: Sun, 28 Jul 2024 15:37:21 +0530 Subject: [PATCH] Fixed: Bugs In Broadcasts --- backend/app/routes/broadcast/getBroadcasts.js | 1 + .../Broadcast/ManageBroadcasts/Card/Card.jsx | 23 +++++++++---------- .../ManageBroadcasts/Card/card.module.scss | 1 + .../Broadcast/Component/Carousel/Carousel.jsx | 16 +++++++++++-- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/backend/app/routes/broadcast/getBroadcasts.js b/backend/app/routes/broadcast/getBroadcasts.js index 26e97c10..d637dc6d 100644 --- a/backend/app/routes/broadcast/getBroadcasts.js +++ b/backend/app/routes/broadcast/getBroadcasts.js @@ -18,6 +18,7 @@ const getBroadcastsAggregate = (startIndex, match) => { expiresOn: 1, createdAt: 1, updatedAt: 1, + isApproved: 1, year: { $year: '$createdAt' }, month: { $month: '$createdAt' }, }, diff --git a/frontend/src/pages/Admin/Components/Broadcast/ManageBroadcasts/Card/Card.jsx b/frontend/src/pages/Admin/Components/Broadcast/ManageBroadcasts/Card/Card.jsx index dac54e7a..6c1ebfc8 100644 --- a/frontend/src/pages/Admin/Components/Broadcast/ManageBroadcasts/Card/Card.jsx +++ b/frontend/src/pages/Admin/Components/Broadcast/ManageBroadcasts/Card/Card.jsx @@ -87,8 +87,8 @@ export function Card(props) { const sanitizedContent = DOMPurify.sanitize(props.project.content); const truncatedContent = - sanitizedContent.length > 400 - ? sanitizedContent.substring(0, 400) + "..." + sanitizedContent.length > 250 + ? sanitizedContent.substring(0, 250) + "..." : sanitizedContent; return ( @@ -167,17 +167,16 @@ export function Card(props) { > View Details +
- + {!props?.project?.isApproved && ( + + )}

{item.title}

-
+
))}