From 3becc777ac4ddb961299ffaaa4e94de21b6bf30d Mon Sep 17 00:00:00 2001 From: Balaharisankar Lakshmanaperumal <114602603+BHS-Harish@users.noreply.github.com> Date: Tue, 30 Jul 2024 19:12:19 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=81=20Bug:=20All=20broadcast=20Should?= =?UTF-8?q?=20show=20approved=20broadcast=20only=20(#1089)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Component/AllBroadcasts/AllBroadcasts.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Broadcast/Component/AllBroadcasts/AllBroadcasts.jsx b/frontend/src/pages/Broadcast/Component/AllBroadcasts/AllBroadcasts.jsx index 1f94b9bb..2895b81a 100644 --- a/frontend/src/pages/Broadcast/Component/AllBroadcasts/AllBroadcasts.jsx +++ b/frontend/src/pages/Broadcast/Component/AllBroadcasts/AllBroadcasts.jsx @@ -82,12 +82,12 @@ export function AllBroadcasts(props) { getData(api); }, [month, page, tags, year]); - const getData = async (api)=>{ + const getData = async (api) => { setLoaded(false); const result = await customBoardcast(api); - setArray(result); + setArray(filterApprovedBroatcast(result)); setLoaded(true); - } + }; return (
); } + +const filterApprovedBroatcast = (broadcasts) => { + return broadcasts.filter((broadcast) => { + return broadcast.isApproved == true; + }); +};