-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
website: Combine fetcher and poster files, update all references to use axios for both GET and POST #663
Conversation
❌ pre-commit failed. |
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.
Thank you! I like this cleanup.
You'll need to merge against main as I think you fixed a bug someone else just fixed.
Also, from the build failure it looks like there's still an import site for |
❌ pre-commit failed. |
Thank you for your review, I have addressed this and updated my pull request. |
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.
The cypress contract tests break due to something changed in oassist_api_client.ts
Can you investigate?
If possible, maybe revert the changes to the |
❌ pre-commit failed. |
❌ pre-commit failed. |
Fix set_label id missing in payload use frontend_message_id pre-commit Refactor api fetcher/poster to axios create lint Remove string literal for path Revert oasst_api_client.ts Fix warning httpStatusCode OasstError optional parameter Refactor remove api base url for local api Lint add blank line
Thank you. I have reverted the change to this file and updated the code to remove the dependency of environment variables for non proxied api calls. A more structured way in the future might be generic hook to call the api which takes an options parameter for any special clauses. |
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.
Thank you for the changes! everything passes!
Hi there,
Firstly, thank you for the amazing work you are doing it's truly inspirational and I'm happy to help if I can. After browsing the front-end code I propose a change. I've made some updates to the application in this PR and I wanted to share them with you.
I've combined the
fetcher
andposter
files into one file,api.ts
, and standardised the use ofaxios
for both GET and POST requests. This should simplify the code and make it easier to maintain going forward. I've also updated all references to these methods throughout the codebase. I noticed that data is run throughJSON.stringify(arg)
I've removed the need for it. By creating an axios api instance we can setup an interceptor which controls the response and reject in one place.Please let me know if you have any questions or concerns, and I'll be happy to address them.
Thank you