From 99b261b1d76e10e32564a32e52d2b656a0a0e8a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 30 Sep 2022 17:31:30 +0200 Subject: [PATCH] [person][relations] Fixed: GET request had a body, this prevented to load files --- .../Resources/public/vuejs/VisGraph/api.js | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/api.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/api.js index 01c335436..afa3d933e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/api.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/api.js @@ -5,8 +5,10 @@ import {makeFetch} from 'ChillMainAssets/lib/api/apiMethods.js'; * @function getFetch * @param url * @returns {Promise} + * @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} */ const getRelationsList = () => { - return getFetch(`/api/1.0/relations/relation.json`) + return makeFetch('GET', `/api/1.0/relations/relation.json`); } /**