<!-- Page de détails d'une adresse postale -->
<template>
  <main>
    <FormOrganizationAddress :id="id" v-if="!fetchState.pending"></FormOrganizationAddress>
  </main>
</template>

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

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