mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
29 lines
772 B
Vue
29 lines
772 B
Vue
<template lang="pug">
|
|
List(:events="events" :title='title')
|
|
</template>
|
|
<script>
|
|
import { mapState } from 'vuex'
|
|
import List from '../../components/List'
|
|
import moment from 'dayjs'
|
|
import get from 'lodash/get'
|
|
|
|
export default {
|
|
layout: 'iframe',
|
|
components: { List },
|
|
async asyncData ({ $axios, req, res }) {
|
|
const title = get(req, 'query.title')
|
|
const tags = req && req.query && req.query.tags
|
|
const places = req && req.query && req.query.places
|
|
const now = new Date()
|
|
|
|
let params = []
|
|
if (places) params.push(`places=${places}`)
|
|
if (tags) params.push(`tags=${tags}`)
|
|
|
|
params = params.length ? `?${params.join('&')}` : ''
|
|
const events = await $axios.$get(`/export/json${params}`)
|
|
|
|
return { events, title }
|
|
},
|
|
}
|
|
</script>
|