Skip to content

Commit

Permalink
Merge pull request #587 from NASA-IMPACT/show-only-published-docs-in-…
Browse files Browse the repository at this point in the history
…documents-view

Show only published ATBDs in the documents view
  • Loading branch information
wrynearson authored Aug 6, 2024
2 parents 6101377 + 402dab1 commit 0bc4656
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 0bc4656

Please sign in to comment.