adding endpoint for LocationType. fetch types and add form fields.

This commit is contained in:
2021-10-13 19:31:48 +02:00
parent b418d13190
commit 4d4662a634
5 changed files with 98 additions and 6 deletions

View File

@@ -24,8 +24,21 @@ const getLocations = () => {
});
};
/*
* Load Location Types
*/
const getLocationTypes = () => {
const url = `/api/1.0/main/location-type.json`;
return fetch(url)
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
};
export {
getSocialIssues,
getSocialActionByIssue,
getLocations
getLocations,
getLocationTypes
};