<!-- Page de détails d'un cycle -->
<template>
  <main>
    <FormParametersCycle :id="id" v-if="!fetchState.pending"></FormParametersCycle>
  </main>
</template>

<script lang="ts">
import {defineComponent, useContext} from '@nuxtjs/composition-api'
import {useDataUtils} from "~/composables/data/useDataUtils";
import {Cycle} from "~/models/Education/Cycle";

export default defineComponent({
  name: 'EditFormParametersCycle',
  setup () {
    const {$dataProvider, route} = useContext()
    const {getItemToEdit} = useDataUtils($dataProvider)
    const id = parseInt(route.value.params.id)
    const {fetchState} = getItemToEdit(id, Cycle)
    return {
      id,
      fetchState
    }
  }
})
</script>
