wire frontend to real APIs - #303
Open
shreeyaadhikari wants to merge 5 commits into
Open
Conversation
shreeyaadhikari
marked this pull request as ready for review
August 3, 2026 23:56
nourshoreibah
requested changes
Aug 8, 2026
nourshoreibah
left a comment
Collaborator
There was a problem hiding this comment.
Some comments on pieces I think may be broken! Would you please add the test-environment label to this pr and test your pr with the account i sent in proj-branch? just to make sure the linking actually workss
|
|
||
| const mockDonors = ['Green Future Foundation', 'Horizon Trust', 'Bright Path Nonprofit', 'Unity Giving Circle', 'Sunrise Community Fund']; | ||
| const mockProjects = ['Clean Water Initiative', 'Youth Mentorship Program', 'Food Security Drive', 'Urban Garden Project', 'STEM Education Fund']; | ||
| const donorsBase = 'http://localhost:3003'; |
Collaborator
There was a problem hiding this comment.
Hard coding this will give invalid URL. we set a global base url that is either localhost or the api gateway url, so you should just be able to append to it
| const [error, setError] = useState<string | null>(null); | ||
|
|
||
| useEffect(() => { | ||
| async function fetchUsers() { |
Collaborator
There was a problem hiding this comment.
We'd want to put this fetch in a custom hook
| useEffect(() => { | ||
| async function fetchUsers() { | ||
| try { | ||
| const json = await api.get<User[] | { data: User[] }>('http://localhost:3001/users'); |
Collaborator
There was a problem hiding this comment.
I think this response shape may be wrong since user can be paginated
| @@ -16,26 +16,40 @@ type Donor = { | |||
| num_projects: number; | |||
Collaborator
There was a problem hiding this comment.
i think this needs to be updated. i dont think we give num_projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ℹ️ Issue
Closes #248
📝 Description
Wire frontend pages to the real backend APIs and make tests CI-friendly by adding deterministic auth + API mocks so typecheck/tests don't fail when calling protected endpoints.
Briefly list the changes made to the code:
✔️ Verification
🏕️ (Optional) Future Work / Notes
I could not test the authenticated flow because I don't have login credentials or a valid access token.
The donations route returned {"message":"Handler 'donations' not found"} when I tried GET /donations.