mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
rename fetch api method
This commit is contained in:
parent
a3b203c306
commit
7ad0e2f2c8
@ -89,14 +89,14 @@ const getCoursesByPerson = (person) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function getRelationship
|
* @function getRelationshipByPerson
|
||||||
* @param person
|
* @param person
|
||||||
* @returns {Promise<Response>}
|
* @returns {Promise<Response>}
|
||||||
*/
|
*/
|
||||||
const getRelationship = (person) => {
|
const getRelationshipByPerson = (person) => {
|
||||||
//console.log('getRelationship', person.id)
|
//console.log('getRelationshipByPerson', person.id)
|
||||||
return getFetch(
|
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 {
|
export {
|
||||||
getHouseholdByPerson,
|
getHouseholdByPerson,
|
||||||
getCoursesByPerson,
|
getCoursesByPerson,
|
||||||
getRelationship,
|
getRelationshipByPerson,
|
||||||
postRelationship
|
postRelationship
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { createStore } from 'vuex'
|
import { createStore } from 'vuex'
|
||||||
import { getHouseholdByPerson, getCoursesByPerson, getRelationship } from './api'
|
import { getHouseholdByPerson, getCoursesByPerson, getRelationshipByPerson } from './api'
|
||||||
import { adapt2vis } from './vis-network'
|
import { adapt2vis } from './vis-network'
|
||||||
|
|
||||||
const debug = process.env.NODE_ENV !== 'production'
|
const debug = process.env.NODE_ENV !== 'production'
|
||||||
@ -208,9 +208,9 @@ const store = createStore({
|
|||||||
*/
|
*/
|
||||||
fetchRelationship({ commit, getters }, person) {
|
fetchRelationship({ commit, getters }, person) {
|
||||||
console.log('fetchRelationship', person)
|
console.log('fetchRelationship', person)
|
||||||
getRelationship(person)
|
getRelationshipByPerson(person)
|
||||||
.then(relationship => new Promise(resolve => {
|
.then(relationship => new Promise(resolve => {
|
||||||
console.log('getRelationship', relationship)
|
console.log('getRelationshipByPerson', relationship)
|
||||||
commit('addRelationship', relationship)
|
commit('addRelationship', relationship)
|
||||||
resolve()
|
resolve()
|
||||||
}))
|
}))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user