fix(order-wizard): pass selectedCompanyId when creating end customer as admin
All checks were successful
Staging Build / build (push) Successful in 2m37s
All checks were successful
Staging Build / build (push) Successful in 2m37s
This commit is contained in:
@@ -392,7 +392,7 @@ export function OrderWizard({
|
||||
if (!newCustomerForm.company_name.trim()) return
|
||||
setIsCreatingCustomer(true)
|
||||
try {
|
||||
const created = await createEndCustomer(newCustomerForm)
|
||||
const created = await createEndCustomer(newCustomerForm, selectedCompanyId || undefined)
|
||||
setEndCustomers(prev => [...prev, created])
|
||||
setSelectedEndCustomerId(created.id)
|
||||
setCustomerMode('select')
|
||||
@@ -400,8 +400,8 @@ export function OrderWizard({
|
||||
company_name: '', vat_id: '', first_name: '', last_name: '', street: '', zip: '', city: '',
|
||||
bank_iban: '', bank_bic: '', bank_name: '', bank_owner: '',
|
||||
})
|
||||
} catch (e) {
|
||||
alert('Fehler beim Anlegen des Kunden.')
|
||||
} catch (e: any) {
|
||||
alert(`Fehler beim Anlegen des Kunden: ${e.message || 'Unbekannter Fehler'}`)
|
||||
} finally {
|
||||
setIsCreatingCustomer(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user