<template>
  <GalleryPage v-if="galleries" :galleries="galleries">
  </GalleryPage>
</template>

<script>
import GalleryPage from '@/components/GalleryPage'

export default {
  name: 'GalleriesPage',

  components: {
    GalleryPage
  },

  data () {
    return {
      galleries: false,
    }
  },

  head () {
    return {
      title: 'My Galleries',
      meta: [{ 
        hid: 'description',
        name: 'description',
        content: 'A showcase of the work of photographer Marc Leopold.'
      }],
    }
  },

  async asyncData ({ $axios }) {
    // TOOD catch errors
    let { galleries } = await $axios.$get('/api/v1/galleries')
    return { galleries }
  },
}
</script>

<style scoped lang="scss">
</style>
