Hi nice plugin btw with JSON:API.
I wonder about way to creating/updating record on
https://github.com/scalient/vuex-orm-json-api/blame/master/README.md#L39-L40
Seems the data parameter is not formatted as described on creating spec and updating spec.
Your restful actions mixin only provides the raw data instead of JSON:API formatted to the json api request on
|
/* |
|
* The Rails-y REST `create` action. |
|
*/ |
|
async create(data = {}, config = {}) { |
|
return this.post(this.restResourcePath(), data, {multiplicity: "one", ...config}); |
|
}, |
|
|
|
/* |
|
* The Rails-y REST `update` action. |
|
*/ |
|
async update(id, data = {}, config = {}) { |
|
// The JSON:API specification seems to prefer `PATCH` over `PUT`: See |
|
// `https://jsonapi.org/format/#crud-updating-resource-relationships`. |
|
return this.patch(this.restResourcePath(id), data, {id, multiplicity: "one", ...config}); |
|
}, |
Can you help me with data request transformer when creating/updating record that comply to JSON:API spec?
Hi nice plugin btw with JSON:API.
I wonder about way to creating/updating record on
https://github.com/scalient/vuex-orm-json-api/blame/master/README.md#L39-L40
Seems the data parameter is not formatted as described on creating spec and updating spec.
Your restful actions mixin only provides the raw data instead of JSON:API formatted to the json api request on
vuex-orm-json-api/src/mixins/RestfulActionsMixin.js
Lines 18 to 32 in db520b9
Can you help me with data request transformer when creating/updating record that comply to JSON:API spec?