fix list of locations in calendar

This commit is contained in:
2022-06-30 19:38:32 +02:00
parent d87c6305fd
commit 71b6b158ba
6 changed files with 19 additions and 18 deletions

View File

@@ -17,7 +17,7 @@ const getLocations = () => fetchResults('/api/1.0/main/location.json');
const getLocationTypes = () => fetchResults('/api/1.0/main/location-type.json');
const getUserCurrentLocation =
const getUserCurrentLocation =
() => fetch('/api/1.0/main/user-current-location.json')
.then(response => {
if (response.ok) { return response.json(); }
@@ -35,6 +35,13 @@ const getLocationTypeByDefaultFor = (entity) => {
);
};
/**
* Post a location
*
* **NOTE**: also in use for Calendar
* @param body
* @returns {Promise<T>}
*/
const postLocation = (body) => {
const url = `/api/1.0/main/location.json`;
return fetch(url, {