cleaning export

This commit is contained in:
les
2020-11-13 00:13:44 +01:00
parent c41c930f70
commit 95e473d531
12 changed files with 134 additions and 112 deletions

View File

@@ -1,11 +1,10 @@
export default ({ $axios, store }, inject) => {
const api = {
/**
* Get events
*
*
* filter: {
* start_datetime: unix_timestamp (default now)
* end_datetime: unix_timestamp
@@ -13,16 +12,18 @@ export default ({ $axios, store }, inject) => {
* places: [place_id],
* limit: (default ∞)
* }
*
*
*/
async getEvents (params) {
try {
const events = await $axios.$get(`/events`, { params: {
start: params.start,
end: params.end,
places: params.places && params.places.join(','),
tags: params.tags && params.tags.join(',')
}} )
const events = await $axios.$get('/events', {
params: {
start: params.start,
end: params.end,
places: params.places && params.places.join(','),
tags: params.tags && params.tags.join(',')
}
})
return events
} catch (e) {
console.error(e)
@@ -31,4 +32,4 @@ export default ({ $axios, store }, inject) => {
}
}
inject('api', api)
}
}