new.vue 916 B

1234567891011121314151617181920212223242526272829303132333435
  1. <!-- Page de détails d'une adresse postale -->
  2. <template>
  3. <main>
  4. <v-skeleton-loader
  5. v-if="loading"
  6. type="text"
  7. />
  8. <FormOrganizationBankAccount :id="item.id" v-else></FormOrganizationBankAccount>
  9. </main>
  10. </template>
  11. <script lang="ts">
  12. import {defineComponent, useContext} from '@nuxtjs/composition-api'
  13. import {UseDataUtils} from "~/use/data/useDataUtils";
  14. import {BankAccount} from "~/models/Core/BankAccount";
  15. export default defineComponent({
  16. name: 'NewBankAccount',
  17. setup (){
  18. const {store} = useContext()
  19. const {createItem} = new UseDataUtils().invoke()
  20. const {create, loading, item} = createItem()
  21. if(process.client){
  22. const itemToCreate: BankAccount = new BankAccount({organization:[`/api/organizations/${store.state.profile.organization.id}`]})
  23. create(itemToCreate, BankAccount)
  24. }
  25. return {
  26. loading,
  27. item
  28. }
  29. }
  30. })
  31. </script>