-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix: replace ofetch native fetch #147
Conversation
- Removed the ofetch dependency from multiple files and replaced it with a customFetch utility for better error handling and flexibility. - Updated API calls in login, pull languages, and user actions to use the new fetch method. - Introduced a new ResponseError interface for improved error management. - Added a getStoryblokUrl utility function to centralize URL construction based on region. - Enhanced error handling in API error management to accommodate the new FetchError class.
- Updated `NetrcMachine` and `SessionState` interfaces to use `RegionCode` for improved type safety. - Refactored login actions to handle optional chaining for better error handling. - Enhanced API calls to utilize the new `customFetch` utility with improved type definitions. - Added tests for `customFetch` to ensure robust error handling and response management.
Hi @edodusi I simplified the fetch method, there was some over-engineering there, I also added some unit tests to it and typing using generics |
@alvarosabu everything works now, just a little note: if I launch the
Is this ok for this command? Or unrelated with this PR? |
You can safely ignore the test command everywhere. It gives you 404 because it's pointing to an unexisting space: |
ofetch
dependency from multiple files and replaced it with acustomFetch
utility for better error handling and flexibility.How to test this PR
Unit tests remained the same. They are all passing
Other information