-
Notifications
You must be signed in to change notification settings - Fork 10
Handle mock API #112
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
Handle mock API #112
Conversation
@mvn-binhnguyen-hn cc: @jacksonjp |
@mvn-binhnguyen-hn |
@jacksonjp @geekonthemove cc: @mvn-binhnguyen-hn @mvn-binhnguyen-hn |
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.
Thanks! As Discussed in the meeting, lets maybe move some of the things around.
const authInterceptor = async (request: AxiosRequestConfig) => { | ||
request.params = toSnakeCase(request.params, true); | ||
request.data = toSnakeCase(request.data, true); | ||
|
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.
Lets leave this to the project, this totally depends on the backend implementation and debugging to find this can be difficult
* @param {AxiosResponse} response | ||
*/ | ||
const responseInterceptor = (response: AxiosResponse) => { | ||
response.data = toCamel(response.data); |
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.
Same here, it can vary from projects
@@ -0,0 +1,7 @@ | |||
import MockAdapter from "axios-mock-adapter"; |
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.
As discussed, lets have it in the readme, instead of adding a package that we might not use.
@@ -0,0 +1,15 @@ | |||
{ |
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.
Lets move it to clients folder, so its easy to cleanup
Both above implementations seem not necessary for the admin panel template, it depends on which project the template will be used, so should we ignore and close this PR? |
@mvn-binhnguyen-hn Yea i think lets close this PR |
@jacksonjp Okay, I closed this PR. thanks 👍 |
Handle mock API
What are you adding?
Clients
screen as template screenBreaking changes?
Related PR