2019-04-29 00:27:29 +02:00
|
|
|
<template lang="pug">
|
2019-05-30 12:04:14 +02:00
|
|
|
List(:events="events" :title='title')
|
2019-04-29 00:27:29 +02:00
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { mapState } from 'vuex'
|
2019-05-30 12:04:14 +02:00
|
|
|
import List from '../../components/List'
|
2019-04-29 00:27:29 +02:00
|
|
|
import moment from 'dayjs'
|
2019-06-11 17:44:11 +02:00
|
|
|
import get from 'lodash/get'
|
2019-04-29 00:27:29 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
layout: 'iframe',
|
2019-05-30 12:04:14 +02:00
|
|
|
components: { List },
|
2019-04-29 00:27:29 +02:00
|
|
|
async asyncData ({ $axios, req, res }) {
|
2019-06-11 17:44:11 +02:00
|
|
|
const title = get(req, 'query.title')
|
2019-06-07 17:02:33 +02:00
|
|
|
const tags = req && req.query && req.query.tags
|
|
|
|
const places = req && req.query && req.query.places
|
2019-05-30 12:04:14 +02:00
|
|
|
const now = new Date()
|
|
|
|
|
2019-05-30 12:12:51 +02:00
|
|
|
let params = []
|
|
|
|
if (places) params.push(`places=${places}`)
|
|
|
|
if (tags) params.push(`tags=${tags}`)
|
2019-05-30 12:04:14 +02:00
|
|
|
|
2019-05-30 12:12:51 +02:00
|
|
|
params = params.length ? `?${params.join('&')}` : ''
|
|
|
|
const events = await $axios.$get(`/export/json${params}`)
|
|
|
|
|
|
|
|
return { events, title }
|
2019-04-29 00:27:29 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|