-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix: improve error handling with HTTP utility functions #8283
Conversation
Implemented a sendRequest utility functions to handle various types of HTTP requests, these functions provide a convenient interface for making API request and interacting with server resources.
updated: pages/account/manage/profile.js
Refactored manage profile sections of the codebase to utilize the new sendRequest utility function for making api requests.
replace fetch with sendRequest, handling error and display error to ui
Hey, could I have some update regarding this PR? |
Sorry for the delay, I have shared with the maintainers and I am waiting to hear their thoughts on it |
I'd greatly appreciate it if you could take another look at the pull request and let me know if the changes align with your expectations. Your expertise is truly valued in ensuring the quality of the code. Thank you for your time and consideration! |
@badrivlog sorry for the delay, PR looks good! |
No problem at all! Thanks for taking the time to review👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea and left a few comments
Thanks for taking the time to review👍 |
Addressed the suggested changes and made updates to the PR👍 Could you please take another look and let me know if everything aligns with your expectations? Your feedback is important to me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm. Nice job
@eddiejaoude, I believe we're now ready to proceed with merging the PR into the main codebase. Could you please take a look at the changes and, if everything looks good to you, give the final approval for merging? |
Thank you @badrivlog for your efforts on this, but after discussing with the other maintainers, we feel it it extra abstraction that is not required, so I will close for now. Sorry for letting this go so far but I was trying to understand the benefit. |
@eddiejaoude,Thank you🙏 for your prompt attention to my PR. I appreciate the time you took to review it and consider its potential impact. While I'm disappointed that the changes didn't align with the project's current direction, I completely understand and respect your decision💯 I'm looking forward to contributing further to the project in a way that aligns with its direction👍 |
Thank you for understanding @badrivlog - yes please continue contributing to LinkFree, I look forward to geeking out more 💪 |
Fixes Issue
Closes #8112
What?
added a new util file
apiRequests.js
, containing functions for sending API requests.Implemented
sendRequest
function that handles various types of API requests, handles rejected promise and also converts theresponse
toJSON
Why?
abstract
api
request functionality into one function that we can use all over our project.These changes improved error handling
How?
replace
fetch
withsendRequest
in manage profile sectionsTesting?
Step to test
localhost:3000/account/manage/profile
(link, milestone, event, testimonials)sendRequest
functionAnything else?
Let's consider implementing it other areas of the project. I will happy to doing that work💪
Check List (Check all the applicable boxes)
Screenshots
Note to reviewers