<template>
  <div>
    {{ film }}
  </div>
</template>

<script>
export default {
  name: "Film",
  head: {
    titleTemplate: "%s - Film"
  },
  validate({ params }) {
    return /([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/.test(params.id);
  },
  async asyncData({ $axios, params }) {
    const film = await $axios.$get(`/api/films/${params.id}`);
    return { film };
  },
  data() {
    return {
      film: {}
    };
  }
};
</script>

<style></style>
