From 7ad0e2f2c803819db97d69928affc1c720e2d54d Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 27 Oct 2021 16:29:16 +0200 Subject: [PATCH] rename fetch api method --- .../Resources/public/vuejs/VisGraph/api.js | 10 +++++----- .../Resources/public/vuejs/VisGraph/store.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/api.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/api.js index 957e01fbc..ee288dcc0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/api.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/api.js @@ -89,14 +89,14 @@ const getCoursesByPerson = (person) => { } /** - * @function getRelationship + * @function getRelationshipByPerson * @param person * @returns {Promise} */ -const getRelationship = (person) => { - //console.log('getRelationship', person.id) +const getRelationshipByPerson = (person) => { + //console.log('getRelationshipByPerson', person.id) return getFetch( - `/api/1.0/relations/relationship/by-person/${person.id}.json`) + `/api/1.0/relations/relationship/by-person/${person._id}.json`) } /** @@ -120,6 +120,6 @@ const postRelationship = (person) => { export { getHouseholdByPerson, getCoursesByPerson, - getRelationship, + getRelationshipByPerson, postRelationship } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/store.js index b4938ff4a..25d044afb 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/store.js @@ -1,5 +1,5 @@ import { createStore } from 'vuex' -import { getHouseholdByPerson, getCoursesByPerson, getRelationship } from './api' +import { getHouseholdByPerson, getCoursesByPerson, getRelationshipByPerson } from './api' import { adapt2vis } from './vis-network' const debug = process.env.NODE_ENV !== 'production' @@ -208,9 +208,9 @@ const store = createStore({ */ fetchRelationship({ commit, getters }, person) { console.log('fetchRelationship', person) - getRelationship(person) + getRelationshipByPerson(person) .then(relationship => new Promise(resolve => { - console.log('getRelationship', relationship) + console.log('getRelationshipByPerson', relationship) commit('addRelationship', relationship) resolve() }))