add a patch resource api endpoint (wip)

This commit is contained in:
2022-01-04 19:37:27 +01:00
parent af2eca0d03
commit 4f1540c541
5 changed files with 94 additions and 2 deletions

View File

@@ -353,6 +353,23 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
throw error;
})
},
patchResource({ commit }, payload) {
const body = { type: "accompanying_period_resource" };
body['resource'] = {
type: payload.result.type,
id: payload.result.id
};
const url = `/api/1.0/person/accompanying-course/resource/${id}.json`;
return makeFetch('PATCH', url, body)
.then((response) => {
commit('patchResource', response);
})
.catch((error) => {
commit('catchError', error);
throw error;
})
},
/**
* On The Fly
*/