From 4faafe6667e7e0739aefd0d37a03264b74883894 Mon Sep 17 00:00:00 2001 From: Mohammad Khyata Date: Thu, 7 May 2026 11:34:07 +0300 Subject: [PATCH] hide company for non company users Co-authored-by: Copilot --- apps/dashboard/modules/customers/customer-form.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/modules/customers/customer-form.tsx b/apps/dashboard/modules/customers/customer-form.tsx index 0f6249c..c2545ff 100644 --- a/apps/dashboard/modules/customers/customer-form.tsx +++ b/apps/dashboard/modules/customers/customer-form.tsx @@ -114,7 +114,7 @@ function mapFormToPayload(values: CustomerFormValues) { const mapLookupOption = (item: any) => ({ value: String(item.id), - label: item.title||item.name || `#${item.id}`, + label: item.title || item.name || `#${item.id}`, }) const STORE_OBJECT = { getOptionValue: (o: any) => o, getOptionLabel: (o: any) => o.label || o.name || `#${o.id}` } @@ -134,6 +134,7 @@ export function CustomerForm({ resourceId, initialData, onSuccess }: CustomerFor mapToFormValues: mapCustomerToFormValues, }) + const { customer_type} = form.watch() const { mutate, error, isPending } = useFormMutation(form, { mutationFn: (values: CustomerFormValues) => { const payload = mapFormToPayload(values) @@ -174,7 +175,7 @@ export function CustomerForm({ resourceId, initialData, onSuccess }: CustomerFor options={SALUTATION_OPTIONS} /> - + + { + customer_type?.label === "Company" && + + } {/* Contact */}