before delete 3software
This commit is contained in:
35
src/pages/CompanyAddPage.vue
Normal file
35
src/pages/CompanyAddPage.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<company-block
|
||||
v-model="newCompany"
|
||||
title="company_create__title_card"
|
||||
btnText="company_create__btn"
|
||||
@update = "addCompany"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import companyBlock from 'components/companyBlock.vue'
|
||||
import { useCompaniesStore } from 'stores/companies'
|
||||
import type { CompanyParams } from 'types/Company'
|
||||
|
||||
const router = useRouter()
|
||||
const companiesStore = useCompaniesStore()
|
||||
|
||||
const newCompany = ref(<CompanyParams>{
|
||||
name: '',
|
||||
logo: '',
|
||||
description: '',
|
||||
site: '',
|
||||
address: '',
|
||||
phone: '',
|
||||
email: ''
|
||||
})
|
||||
|
||||
async function addCompany () {
|
||||
await companiesStore.add(newCompany.value)
|
||||
router.go(-1)
|
||||
}
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user