Namespace

actions

jsonapi-vuex.jsonapiModule.actions

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.

View Source actions.js, line 1

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 module:jsonapi-vuex.jsonapiModule.actions for a summary of args

string

A URL path to an item - e.g. endpoint/1

object

A restructured object - e.g. { _jv: { type: "endpoint", id: "1" } }

array

A 2-element array, consisting of a string/object and an optional axios config object

View Source actions.js, line 244

Restructured representation of the deleted item

object

# 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 module:jsonapi-vuex.jsonapiModule.actions for a summary of args

string

A URL path to an item - e.g. endpoint/1

object

A restructured object - e.g. { _jv: { type: "endpoint", id: "1" } }

array

A 2-element array, consisting of a string/object and an optional axios config object

View Source actions.js, line 34

Restructured representation of the requested item(s)

object

# 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 module:jsonapi-vuex.jsonapiModule.actions for a summary of args

string

A URL path to an item - e.g. endpoint/1

object

A restructured object - e.g. { _jv: { type: "endpoint", id: "1" } }

array

A 2-element array, consisting of a string/object and an optional axios config object

View Source actions.js, line 71

Restructured representation of the requested item(s)

object

# 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 module:jsonapi-vuex.jsonapiModule.actions for a summary of args

object

A restructured object - e.g. { _jv: { type: "endpoint", id: "1" } }

array

A 2-element array, consisting of a string/object and an optional axios config object

View Source actions.js, line 201

Restructured representation of the patched item

object

# 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 module:jsonapi-vuex.jsonapiModule.actions for a summary of args

object

A restructured object - e.g. { _jv: { type: "endpoint", id: "1" } }

array

A 2-element array, consisting of a string/object and an optional axios config object

View Source actions.js, line 169

Restructured representation of the posted item

object

# 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 module:jsonapi-vuex.jsonapiModule.actions for a summary of args

string

A URL path to an item - e.g. endpoint/1

object

A restructured object - e.g. { _jv: { type: "endpoint", id: "1" } }

array

A 2-element array, consisting of a string/object and an optional axios config object

See:

View Source actions.js, line 273

Restructured representation of the posted item

object