Skip to content
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

[Feature] Refactor to use real backend endpoints #50

Merged

Conversation

chrehall68
Copy link
Collaborator

@chrehall68 chrehall68 commented Sep 10, 2024

  • Replaces all calls to fakeFetch with calls to serverFetch, which follows a similar format, but makes real requests. To do so, it references the environment variable NEXT_PUBLIC_BACKEND_URL. When testing, I used http://localhost:8000/core since I ran the backend on port 8000 on my computer.
  • Updates all components to use the data names supplied by the backend.
    • In some cases, the backend didn't return all the data that some components needed. These cases have been marked with a TODO in the code and filled with temporary placeholder values
  • Updates the Mock API to conform to the same schema as the real API.
  • Standardizes return type names to what they were before 48 [Feature] Update Endpoint return types #49 (which accidentally changed some names)

I tested this PR with SJSUCSClub/course-scheduling-server@6dcf1e8

@chrehall68 chrehall68 linked an issue Sep 10, 2024 that may be closed by this pull request
4 tasks
Copy link

vercel bot commented Sep 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
course-scheduling-client ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 4:49am

Copy link
Collaborator

@ahmadgaz ahmadgaz left a comment

Choose a reason for hiding this comment

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

Awesome lgtm

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's eventually replace serverFetch calls with SWR. It has some useful pagination and caching features and handles loading/error states out of the box. For now this is OK.

@ahmadgaz ahmadgaz merged commit 38292e2 into develop Sep 10, 2024
5 checks passed
@chrehall68 chrehall68 deleted the 31-feature-refactor-mockapi-to-reflect-backend-endpoints branch September 10, 2024 20:30
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.

[Feature] Refactor MockApi to reflect backend endpoints
2 participants