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

kenny/8 Service util setup #16

Merged
merged 7 commits into from
Feb 4, 2025
Merged

kenny/8 Service util setup #16

merged 7 commits into from
Feb 4, 2025

Conversation

KennyKeni
Copy link
Contributor

Service util setup

Issue Number(s): #8

What does this PR change and why?

Checklist

  • A service util layer has been created which exports TS functions that handles all HTTP requests and responses
  • These exported functions are imported with the frontend pages and components that utilize them, and work, facilitating communication between the frontend and backend.
  • A separate file is created for each endpoint: one for auth, one for pets

Critical Changes

  • Created fetchAPI.ts to handle api calls to the backend
  • Created individual files for auth and pets along with the required calls

Related PRs

Testing

N/A

@michaelhyi michaelhyi marked this pull request as ready for review February 1, 2025 22:27
Copy link
Contributor

@michaelhyi michaelhyi left a comment

Choose a reason for hiding this comment

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

Great work overall! I just left some small comments. Thanks for all your hard work!

src/services/fetchAPI.ts Outdated Show resolved Hide resolved
src/services/fetchAPI.ts Outdated Show resolved Hide resolved
src/services/fetchAPI.ts Outdated Show resolved Hide resolved
src/services/fetchAPI.ts Outdated Show resolved Hide resolved
src/services/fetchAPI.ts Outdated Show resolved Hide resolved
src/services/authService.ts Outdated Show resolved Hide resolved
src/services/authService.ts Outdated Show resolved Hide resolved
src/services/petService.ts Outdated Show resolved Hide resolved
src/services/petService.ts Outdated Show resolved Hide resolved
src/services/petService.ts Outdated Show resolved Hide resolved
@KennyKeni
Copy link
Contributor Author

UserId is a number in authService, while a string in petService, is this intended? Also should fetchService also take the 'HEAD' and 'OPTIONS' request methods? Should the response also include the header?

Copy link
Contributor

@michaelhyi michaelhyi left a comment

Choose a reason for hiding this comment

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

Looks great Kenny!

@michaelhyi michaelhyi merged commit 03fcf97 into main Feb 4, 2025
3 checks passed
@michaelhyi michaelhyi deleted the kenny/8-service-util-setup branch February 4, 2025 04:19
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.

2 participants