From 62f960ebf4680cb6fda1c4bb2b13ea197a711d07 Mon Sep 17 00:00:00 2001
From: Shivam Gaur <128178418+shivamgaur99@users.noreply.github.com>
Date: Sun, 28 Jul 2024 19:34:00 +0530
Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=81=20Fixed:=20Bugs=20In=20Broadcasts?=
=?UTF-8?q?=20(#1082)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
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}
-
+
))}