Skip to content

Create axios instance to perform API calls#69

Merged
sathyanarayanan-v merged 2 commits intoChicoState:mainfrom
sathyanarayanan-v:create-axios-instance
Mar 29, 2023
Merged

Create axios instance to perform API calls#69
sathyanarayanan-v merged 2 commits intoChicoState:mainfrom
sathyanarayanan-v:create-axios-instance

Conversation

@sathyanarayanan-v
Copy link
Copy Markdown
Contributor

@sathyanarayanan-v sathyanarayanan-v commented Mar 23, 2023

Why?

  • We need token to be attached for every requests in the header.
  • Axios does it out of the box using request interceptor

Assumption made

  • Tokens are stored in the localstorage with the key token

@SANDESHSOBARAD

xl26
xl26 previously approved these changes Mar 23, 2023
@sathyanarayanan-v
Copy link
Copy Markdown
Contributor Author

@prestonmasseyblake and @AbhinavReddy-Dev can you review this?

@AbhinavReddy-Dev AbhinavReddy-Dev self-requested a review March 28, 2023 23:46
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally haven't implemented this version of axios, but it looks like a cleaner way to attach the Auth token to every request.

},
"dependencies": {
"@types/passport": "^1.0.12",
"axios": "^1.3.4",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need an axios in this directory.

@sathyanarayanan-v sathyanarayanan-v requested a review from xl26 March 29, 2023 00:02
@sathyanarayanan-v sathyanarayanan-v merged commit e350e94 into ChicoState:main Mar 29, 2023
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.

3 participants