Skip to content

Commit

Permalink
Pass axios config through for getRelated calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrichar1 committed Oct 31, 2023
1 parent 354d8e6 commit d9eef14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsonapi-vuex",
"version": "5.13.0",
"version": "5.13.1",
"description": "Access restructured JSONAPI data from a Vuex Store.",
"author": "Matthew Richardson <M.Richardson@ed.ac.uk>",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const actions = (api, conf) => {
* @return {object} Restructured representation of the requested item(s)
*/
getRelated: async (context, args) => {
const data = utils.unpackArgs(args)[0]
const [data, config] = utils.unpackArgs(args)
let [type, id, relName] = utils.getTypeId(data)
if (!type || !id) {
throw 'No type/id specified'
Expand Down Expand Up @@ -156,7 +156,7 @@ const actions = (api, conf) => {
// so fetch relationships resource linkage for these
if (!relItems) {
try {
const resLink = await api.get(`${type}/${id}/relationships/${relName}`)
const resLink = await api.get(`${type}/${id}/relationships/${relName}`, config)
relItems = resLink.data
} catch (error) {
throw `No such relationship: ${relName}`
Expand Down Expand Up @@ -185,7 +185,7 @@ const actions = (api, conf) => {
entry = { [jvtag]: entry }
}
relNames.push(relName)
relPromises.push(context.dispatch('get', entry))
relPromises.push(context.dispatch('get', [entry, config]))
}
} else {
// Empty to-one rels should have a relName but no data
Expand Down

0 comments on commit d9eef14

Please sign in to comment.