Releases: victor-am/rails-ranger
Releases · victor-am/rails-ranger
0.4.0
- Axios updated to 0.17.1 (PR #20)
- Added the
.resource
function to access nested resources within Rails (PR #19)
Example of the .resource
function usage:
api.resource('users', 1).list('blogPosts')
//=> GET request to /users/1/blog_posts
0.3.4
On this version we:
- Added a
[Rails Ranger]
identifier to rails-ranger error messages
- Fixed the missing conversion of the resource name from camelCase to snake_case
0.3.3
Added support for the injection of nested objects into the query params, such as:
// Giving the following params
{ filters: { userId: 1 } }
// Into a GET/DELETE request through Rails Ranger, would lead to the following URL:
myurl.com?filters[userId]=1
0.3.2
Bugfixes
- Fixes the bug reported on #10 which messed up with parameters given to POST, PATCH and PUT requests.
0.3.1
Bugfixes
- RailsRanger constructor defaults are working as expected now
- Response data transformations now take advantage of Axios defaults to handle things properly
0.3.0
Added automatic data transformation of request and response:
- Request data like
{ firstName: 'John' }
will be converted to { first_name: 'John' }
before the request.
- Response data like
{ first_name: 'John' }
will be converted to { firstName: 'John' }
before being handled to the user.
Also, the transformData
option flag was added, to disable the behavior above if the user doesn't want it.
Separation of Rails Ranger options and Axios options
Now to pass options to Axios the user should use the axios
key. For example:
new RailsRanger({ axios: { baseUrl: 'http://www.google.com' } })