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

Feature: Add Axios interceptors #6

Merged
merged 4 commits into from
Jul 17, 2024
Merged

Conversation

juanchoperezj
Copy link

What does this do?

Perform a transform in both data objects from the response/request through Axios.
Often, our backend APIs uses snake_case, transforming these objects to pascalCase is the way to go for us to use them in this template.

Why did you do this?

  • Avoid modification of the object to be sent to the API.
  • DYI by using interceptors and two util functions.

Who/what does this impact?

Impact on the HTTP client, every request/response is transformed.

How did you test this?

Test the output of both new util functions

@juanchoperezj juanchoperezj requested a review from a team as a code owner July 16, 2024 22:00
@juanchoperezj juanchoperezj self-assigned this Jul 16, 2024
Copy link

github-actions bot commented Jul 16, 2024

💯 Test Coverage

Lines Statements Branches Functions
Coverage: 40%
39.96% (203/508) 35.39% (80/226) 25.77% (50/194)

😎 Tests Results

Tests Skipped Failures Errors Time
44 0 💤 0 ❌ 0 🔥 25.441s ⏱️
👀 Tests Details • (40%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files39.9635.3925.7740.99 
api/common45.4527.7726.6646.34 
   client.tsx010010004
   interceptors.ts0100007–18
   utils.tsx60.627.774063.3314–40
app0000 
   _layout.tsx000020–67
components/settings0000 
   items-container.tsx000011–12
ui71.552.5559.3772 
   select.tsx77.1453.8471.4276.47183, 233–243, 254

@juanchoperezj juanchoperezj merged commit 8f607db into master Jul 17, 2024
6 checks passed
@juanchoperezj juanchoperezj deleted the feature/add-interceptors branch July 17, 2024 18:46
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