File tree Expand file tree Collapse file tree 3 files changed +245
-251
lines changed
apps/superadmin/src/components/tenants
packages/shared/src/config Expand file tree Collapse file tree 3 files changed +245
-251
lines changed Original file line number Diff line number Diff line change 11import {
2- Alert ,
3- Button ,
4- features ,
5- Icon ,
6- Input ,
7- Modal ,
8- MultiStepForm ,
9- Spinner ,
10- Textarea ,
11- ToastContainer ,
12- useFormValidation ,
13- useMultiStepForm ,
14- useToast ,
15- ValidationRules ,
16- type CreateTenantRequest ,
17- type Step ,
18- type Tenant ,
19- type ToastProps ,
2+ Alert ,
3+ Button ,
4+ features ,
5+ Icon ,
6+ Input ,
7+ Modal ,
8+ MultiStepForm ,
9+ Spinner ,
10+ Textarea ,
11+ ToastContainer ,
12+ useFormValidation ,
13+ useMultiStepForm ,
14+ useToast ,
15+ ValidationRules ,
16+ type CreateTenantRequest ,
17+ type Step ,
18+ type Tenant ,
19+ type ToastProps ,
2020} from '@ngo-platform/shared' ;
2121import { useQueryClient } from '@tanstack/react-query' ;
2222import { useEffect , useState , type FC } from 'react' ;
23-
2423interface TenantFormDialogProps {
2524 isOpen : boolean ;
2625 onClose : ( ) => void ;
@@ -55,7 +54,7 @@ export const TenantFormDialog: FC<TenantFormDialogProps> = ({
5554
5655 // Fetch full details in edit mode to ensure we have all fields
5756 const { data : tenantDetails , isLoading : isLoadingDetails } = features . useTenant (
58- ( mode === 'edit' && initialData ?. id ) ? initialData . id : '' ,
57+ mode === 'edit' && initialData ?. id ? initialData . id : '' ,
5958 ) ;
6059
6160 const [ formData , setFormData ] = useState < TenantFormData > ( {
@@ -225,9 +224,9 @@ export const TenantFormDialog: FC<TenantFormDialogProps> = ({
225224 tenantId = result . id ;
226225 success ( 'Tenant created successfully' , `${ formData . name } has been added to the platform` ) ;
227226 } else {
228- if ( ! initialData ?. id ) throw new Error ( " Tenant ID missing for update" ) ;
227+ if ( ! initialData ?. id ) throw new Error ( ' Tenant ID missing for update' ) ;
229228
230- const updateRequest = {
229+ const updateRequest = {
231230 id : initialData . id ,
232231 name : formData . name ,
233232 email : formData . email ,
You can’t perform that action at this time.
0 commit comments