Releases: vuex-orm/plugin-axios
v0.9.4
v0.9.3
v0.9.2
v0.9.1
v0.9.0
New Features
Save response data after calling the API
When setting the save
option to false
, now you can persist response data afterward via save
method on the response object.
// Don't save response data when calling API.
const result = await User.api().get('/api/users', {
save: false
})
// Save data afterwards.
result.save()
Please refer to the documentation for more.
v0.8.0
New Features
Transform response data before persisting to the store.
Now you can transform response data by the new dataTransformer
option.
This option will let you transform the response before persisting it to the store. Let's say your response from the server looks like below.
{
ok: true,
record: {
id: 1,
name: 'John Doe'
}
}
You can use dataTransform
property to specify how you want to transform the data. The whole Axios response will be passed as callback argument.
User.api().get('/api/users', {
dataTransformer: (response) => {
return response.data.record
}
})
With the above config, the data inside record
key will be inserted to the store.
It is very useful when you need to transform a given response to be handle by Vuex ORM. For instance, if you format your response with the JSON:API specs, you can transform your response with this callback.
Please check out the doc for more details.
Thanks so much to @guillaumebriday for this wonderful PR! 🎉
v0.7.0
Fresh Start
Vuex ORM Axios has been rewritten from scratch, ground up. All features from setting up the plugin and how use has become very different.
I hate to bring this big breaking change, but I believe it is going to make things much simpler, and also easier to maintain.
Please read through fresh new documentation on how to use the plugin.
If you find anything, please feel free to open an issue!
There's a lot of space where the plugin can be improved. We'll keep making better, so if you have any feedback, please let us know!
v0.5.1
0.5.0
Updated Package Number
0.4.0
Updated Version Number