mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 08:03:49 +00:00
Merge branch 'master' into 111_exports_suite
This commit is contained in:
@@ -5,8 +5,10 @@ import {makeFetch} from 'ChillMainAssets/lib/api/apiMethods.js';
|
||||
* @function getFetch
|
||||
* @param url
|
||||
* @returns {Promise<Response>}
|
||||
* @deprecated use makeFetch instead
|
||||
*/
|
||||
const getFetch = (url) => {
|
||||
console.error('deprecated method');
|
||||
return makeFetch('GET', url, null)
|
||||
}
|
||||
|
||||
@@ -51,8 +53,10 @@ const getHouseholdByPerson = (person) => {
|
||||
if (person.current_household_id === null) {
|
||||
throw 'Currently the person has not household!'
|
||||
}
|
||||
return getFetch(
|
||||
`/api/1.0/person/household/${person.current_household_id}.json`)
|
||||
return makeFetch(
|
||||
'GET',
|
||||
`/api/1.0/person/household/${person.current_household_id}.json`
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,8 +66,10 @@ const getHouseholdByPerson = (person) => {
|
||||
*/
|
||||
const getCoursesByPerson = (person) => {
|
||||
//console.log('getCoursesByPerson', person._id)
|
||||
return getFetch(
|
||||
`/api/1.0/person/accompanying-course/by-person/${person._id}.json`)
|
||||
return makeFetch(
|
||||
'GET',
|
||||
`/api/1.0/person/accompanying-course/by-person/${person._id}.json`
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,8 +79,10 @@ const getCoursesByPerson = (person) => {
|
||||
*/
|
||||
const getRelationshipsByPerson = (person) => {
|
||||
//console.log('getRelationshipsByPerson', person.id)
|
||||
return getFetch(
|
||||
`/api/1.0/relations/relationship/by-person/${person._id}.json`)
|
||||
return makeFetch(
|
||||
'GET',
|
||||
`/api/1.0/relations/relationship/by-person/${person._id}.json`
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +90,7 @@ const getRelationshipsByPerson = (person) => {
|
||||
* @returns {Promise<Response>}
|
||||
*/
|
||||
const getRelationsList = () => {
|
||||
return getFetch(`/api/1.0/relations/relation.json`)
|
||||
return makeFetch('GET', `/api/1.0/relations/relation.json`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user