[person][relations] Fixed: GET request had a body, this prevented to

load files
This commit is contained in:
Julien Fastré 2022-09-30 17:31:30 +02:00
parent a91b35298a
commit 99b261b1d7

View File

@ -5,8 +5,10 @@ import {makeFetch} from 'ChillMainAssets/lib/api/apiMethods.js';
* @function getFetch * @function getFetch
* @param url * @param url
* @returns {Promise<Response>} * @returns {Promise<Response>}
* @deprecated use makeFetch instead
*/ */
const getFetch = (url) => { const getFetch = (url) => {
console.error('deprecated method');
return makeFetch('GET', url, null) return makeFetch('GET', url, null)
} }
@ -51,8 +53,10 @@ const getHouseholdByPerson = (person) => {
if (person.current_household_id === null) { if (person.current_household_id === null) {
throw 'Currently the person has not household!' throw 'Currently the person has not household!'
} }
return getFetch( return makeFetch(
`/api/1.0/person/household/${person.current_household_id}.json`) 'GET',
`/api/1.0/person/household/${person.current_household_id}.json`
);
} }
/** /**
@ -62,8 +66,10 @@ const getHouseholdByPerson = (person) => {
*/ */
const getCoursesByPerson = (person) => { const getCoursesByPerson = (person) => {
//console.log('getCoursesByPerson', person._id) //console.log('getCoursesByPerson', person._id)
return getFetch( return makeFetch(
`/api/1.0/person/accompanying-course/by-person/${person._id}.json`) 'GET',
`/api/1.0/person/accompanying-course/by-person/${person._id}.json`
);
} }
/** /**
@ -73,8 +79,10 @@ const getCoursesByPerson = (person) => {
*/ */
const getRelationshipsByPerson = (person) => { const getRelationshipsByPerson = (person) => {
//console.log('getRelationshipsByPerson', person.id) //console.log('getRelationshipsByPerson', person.id)
return getFetch( return makeFetch(
`/api/1.0/relations/relationship/by-person/${person._id}.json`) 'GET',
`/api/1.0/relations/relationship/by-person/${person._id}.json`
);
} }
/** /**
@ -82,7 +90,7 @@ const getRelationshipsByPerson = (person) => {
* @returns {Promise<Response>} * @returns {Promise<Response>}
*/ */
const getRelationsList = () => { const getRelationsList = () => {
return getFetch(`/api/1.0/relations/relation.json`) return makeFetch('GET', `/api/1.0/relations/relation.json`);
} }
/** /**