Skip to content

Commit

Permalink
Show only published ATBDs in the documents view
Browse files Browse the repository at this point in the history
  • Loading branch information
sunu committed Jul 22, 2024
1 parent 6101377 commit 402dab1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/assets/scripts/components/documents/hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 402dab1

Please sign in to comment.