mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-12 01:34:58 +00:00
vue_activity location: add NewLocation fields, submit activity form with hidden field (+)
This commit is contained in:
@@ -36,9 +36,28 @@ const getLocationTypes = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Post a Location
|
||||
*/
|
||||
const postLocation = (body) => {
|
||||
const url = `/api/1.0/main/location.json`;
|
||||
return fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8'
|
||||
},
|
||||
body: JSON.stringify(body)
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
};
|
||||
|
||||
export {
|
||||
getSocialIssues,
|
||||
getSocialActionByIssue,
|
||||
getLocations,
|
||||
getLocationTypes
|
||||
getLocationTypes,
|
||||
postLocation
|
||||
};
|
||||
|
Reference in New Issue
Block a user