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

Fix/axios calls params #40

Merged
merged 3 commits into from
Nov 28, 2019
Merged

Fix/axios calls params #40

merged 3 commits into from
Nov 28, 2019

Conversation

kwajiehao
Copy link
Contributor

@kwajiehao kwajiehao commented Nov 28, 2019

axios takes in params differently when it makes different kinds of requests. For example, a GET or a DELETE request should be structured:

axios.get(endpoint, { params, headers })

But when doing PUT requests, the params is a separate argument:

axios.put(endpoint, params, { headers })

This PR fixes some mistakes made in the way we made axios requests before. Namely:

  • When making GET calls, we sometimes passed params as a separate argument
  • When making DELETE calls, we passed params under a data attribute

Copy link
Contributor

@taufiq taufiq left a comment

Choose a reason for hiding this comment

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

lgtmag

@kwajiehao kwajiehao merged commit 944f3bf into staging Nov 28, 2019
@kwajiehao kwajiehao deleted the fix/axios-calls-params branch November 28, 2019 08:28
prestonlimlianjie pushed a commit that referenced this pull request Dec 6, 2019
* fix: change the way params are passed into different axios calls

* fix: change the way params are passed into different axios calls for Config and Directory

* fix: correct the way params are passed into axios delete
harishv7 pushed a commit that referenced this pull request Feb 17, 2023
* fix: change the way params are passed into different axios calls

* fix: change the way params are passed into different axios calls for Config and Directory

* fix: correct the way params are passed into axios delete
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