adding an API GET Location endpoint, fetch locations and list them in vue multiselect

This commit is contained in:
2021-10-13 14:22:53 +02:00
parent 342c462ed7
commit 48f3c440a2
5 changed files with 91 additions and 7 deletions

View File

@@ -3,16 +3,29 @@ import { getSocialIssues } from 'ChillPersonAssets/vuejs/AccompanyingCourse/api.
/*
* Load socialActions by socialIssue (id)
*/
const getSocialActionByIssue = (id) => {
const getSocialActionByIssue = (id) => {
const url = `/api/1.0/person/social/social-action/by-social-issue/${id}.json`;
return fetch(url)
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
throw Error('Error with request resource response');
});
};
/*
* Load Locations
*/
const getLocations = () => {
const url = `/api/1.0/main/location.json`;
return fetch(url)
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
};
export {
getSocialIssues,
getSocialActionByIssue
getSocialActionByIssue,
getLocations
};