fix: create Account Page
This commit is contained in:
@@ -77,14 +77,42 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
password: string,
|
||||
confirm_password: string,
|
||||
lang?: string,
|
||||
company_name?: string,
|
||||
company_email?: string,
|
||||
company_address?: {
|
||||
street: string
|
||||
zipCode: string
|
||||
city: string
|
||||
country: string
|
||||
},
|
||||
regon?: string,
|
||||
nip?: string,
|
||||
vat?: string,
|
||||
billing_address?: {
|
||||
street: string
|
||||
zipCode: string
|
||||
city: string
|
||||
country: string
|
||||
},
|
||||
) {
|
||||
loading.value = true
|
||||
error.value = null
|
||||
try {
|
||||
const body: any = { first_name, last_name, email, password, confirm_password, lang: lang || 'en' }
|
||||
|
||||
// Add company information if provided
|
||||
if (company_name) body.company_name = company_name
|
||||
if (company_email) body.company_email = company_email
|
||||
if (company_address) body.company_address = company_address
|
||||
if (regon) body.regon = regon
|
||||
if (nip) body.nip = nip
|
||||
if (vat) body.vat = vat
|
||||
if (billing_address) body.billing_address = billing_address
|
||||
|
||||
await useFetchJson('/api/v1/public/auth/register', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ first_name, last_name, email, password, confirm_password, lang: lang || 'en' }),
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
|
||||
return { success: true, requiresVerification: true }
|
||||
|
||||
Reference in New Issue
Block a user