From 402dab1e6cb1f598cde96f72f8d1624bf3504f85 Mon Sep 17 00:00:00 2001 From: Tarashish Mishra Date: Mon, 22 Jul 2024 15:13:37 +0530 Subject: [PATCH] Show only published ATBDs in the documents view --- app/assets/scripts/components/documents/hub/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/scripts/components/documents/hub/index.js b/app/assets/scripts/components/documents/hub/index.js index 494fe082..156bdd02 100644 --- a/app/assets/scripts/components/documents/hub/index.js +++ b/app/assets/scripts/components/documents/hub/index.js @@ -21,6 +21,7 @@ import { Link } from '../../../styles/clean/link'; import { useAtbds } from '../../../context/atbds-list'; import CreateDocumentButton from '../../documents/create-document-button'; +import { PUBLISHED } from '../../documents/status'; export const DocList = styled.ol` grid-column: content-start / content-end; @@ -36,10 +37,10 @@ export const DocListItem = styled.li` `; function Documents() { - const { fetchAtbds, atbds } = useAtbds(); + const { fetchAtbds, atbds } = useAtbds({ status: PUBLISHED }); useEffect(() => { - fetchAtbds(); + fetchAtbds({ status: PUBLISHED }); }, [fetchAtbds]); // We only want to handle errors when the atbd request fails. Mutation errors,