Skip to content

Commit

Permalink
Bug: All broadcast Should show approved broadcast only
Browse files Browse the repository at this point in the history
  • Loading branch information
BHS-Harish committed Jul 29, 2024
1 parent 15c21dc commit d587c07
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<main
Expand Down Expand Up @@ -219,3 +219,9 @@ export function AllBroadcasts(props) {
</main>
);
}

const filterApprovedBroatcast = (broadcasts) => {
return broadcasts.filter((broadcast) => {
return broadcast.isApproved == true;
});
};

0 comments on commit d587c07

Please sign in to comment.