<template>
  <wrapper
    fill
    margin
    padding
    background
  >
    <schedule
      class="l-flex__auto"
      :schedule="scheduleId"
      @submit="onSubmit"
    />
  </wrapper>
</template>

<script>
export default {
  name: 'ScheduleDesginer',
  props: {
    redirect: {
      type: String,
      default: ''
    }
  },
  computed: {
    scheduleId () {
      return this.$route.params.id
    }
  },
  methods: {
    onSubmit () {
      if (this.redirect) {
        this.$router.replace({
          name: this.redirect,
          params: { refresh: true }
        })
      }
    }
  }
}
</script>
