update list of referrers when loading and updating some parts of the course

This commit is contained in:
2021-10-20 15:03:42 +02:00
parent c8762d2bc2
commit 0a058bad82
4 changed files with 55 additions and 25 deletions

View File

@@ -1,3 +1,5 @@
import { fetchResults } from 'ChillMainAssets/lib/api/download.js';
/*
* Endpoint v.2 chill_api_single_accompanying_course__entity
* method GET/HEAD, get AccompanyingCourse Instance
@@ -216,8 +218,6 @@ const addScope = (id, scope) => {
const removeScope = (id, scope) => {
const url = `/api/1.0/person/accompanying-course/${id}/scope.json`;
console.log(url);
console.log(scope);
return fetch(url, {
method: 'DELETE',
@@ -235,6 +235,12 @@ const removeScope = (id, scope) => {
});
};
const getAvailableReferrals = (course) => {
const url = `/api/1.0/person/accompanying-course/${course.id}/referral-availables.json`;
return fetchResults(url);
}
export {
getAccompanyingCourse,
patchAccompanyingCourse,
@@ -249,4 +255,5 @@ export {
postSocialIssue,
addScope,
removeScope,
getAvailableReferrals
};