Skip to content

Ticket 116 - mockup for API call #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

KayTV
Copy link

@KayTV KayTV commented Mar 11, 2025

Ticket

Resolves #116

Changes

Added in an API example

Context for reviewers

Created a new file for the service calls and called it on the health page in order to display member information

Testing

Screenshot 2025-03-11 at 1 37 01 PM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) The "health" page is often used to make sure the application is working, think we still use that on grants.gov https://github.com/HHS/simpler-grants-gov/blob/main/frontend/src/app/%5Blocale%5D/health/page.tsx . I would recommend keeping it as is and creating a separate page for this.

@@ -1,3 +1,37 @@
'use client'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) This means the whole may be rendered in the client. Alternatively the members list could be a client component that the page uses so the page could still be rendered server side.

export default function Page() {
return <>healthy</>;
const [members, setMembers] = useState<Member[]>([]);
Copy link
Member

@acouch acouch May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have an error and loading states.


useEffect(() => {
getMembers();
}, []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getMembers should be a dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add example API request approach
2 participants