activity: add location of the accompanying course

This commit is contained in:
nobohan
2021-11-23 16:10:34 +01:00
parent b808e970ab
commit 1519fcd4dd
3 changed files with 38 additions and 20 deletions

View File

@@ -36,6 +36,17 @@ const getLocationTypes = () => {
});
};
/*
* Load Location Types by defaultFor
* @param {string} entity - can be "person" or "thirdparty"
*/
const getLocationTypesByDefaultFor = (entity) => {
return getLocationTypes().then(response =>
response.results.filter(t => t.defaultFor === entity)[0]
);
};
/*
* Post a Location
*/
@@ -59,5 +70,6 @@ export {
getSocialActionByIssue,
getLocations,
getLocationTypes,
getLocationTypesByDefaultFor,
postLocation
};