Vuex actions, used via this.$store.dispatch
, e.g.:
this.$store.dispatch('jv/get', <args>)
args
can be either a string or an object representing the item(s) required,
or it can be an array of string/object and an optional axios config object.
Methods
# async static delete(context, args) → {object}
Delete an item from the API
Parameters:
Name | Type | Description |
---|---|---|
context |
object | Vuex context object |
args |
string | object | array | See |
|
string | A URL path to an item - e.g. |
|
object | A restructured object - e.g. |
|
array | A 2-element array, consisting of a string/object and an optional axios config object |
Restructured representation of the deleted item
# async static get(context, args) → {object}
Get items from the API
Parameters:
Name | Type | Description |
---|---|---|
context |
object | Vuex context object |
args |
string | object | array | See |
|
string | A URL path to an item - e.g. |
|
object | A restructured object - e.g. |
|
array | A 2-element array, consisting of a string/object and an optional axios config object |
Restructured representation of the requested item(s)
# async static getRelated(context, args) → {object}
Get related items from the API
Parameters:
Name | Type | Description |
---|---|---|
context |
object | Vuex context object |
args |
string | object | array | See |
|
string | A URL path to an item - e.g. |
|
object | A restructured object - e.g. |
|
array | A 2-element array, consisting of a string/object and an optional axios config object |
Restructured representation of the requested item(s)
# async static patch(context, args) → {object}
Patch an item in the API
Parameters:
Name | Type | Description |
---|---|---|
context |
object | Vuex context object |
args |
object | array | See |
|
object | A restructured object - e.g. |
|
array | A 2-element array, consisting of a string/object and an optional axios config object |
Restructured representation of the patched item
# async static post(context, args) → {object}
Post an item to the API
Parameters:
Name | Type | Description |
---|---|---|
context |
object | Vuex context object |
args |
object | array | See |
|
object | A restructured object - e.g. |
|
array | A 2-element array, consisting of a string/object and an optional axios config object |
Restructured representation of the posted item
# async static search(context, args) → {object}
Get items from the API without updating the Vuex store
Parameters:
Name | Type | Description |
---|---|---|
context |
object | Vuex context object |
args |
string | object | array | See |
|
string | A URL path to an item - e.g. |
|
object | A restructured object - e.g. |
|
array | A 2-element array, consisting of a string/object and an optional axios config object |
Restructured representation of the posted item