From 621670ffbc98bd5e7926c9b9f0bba494f7adba2e Mon Sep 17 00:00:00 2001 From: Yashwin Date: Thu, 29 Jan 2026 17:42:07 +0530 Subject: [PATCH] Refactor theme hook and update tenant creation logic to improve clarity and consistency. Remove unused tenant_id from Users component and ensure proper variable naming in CreateTenantWizard. --- src/hooks/useTenantTheme.ts | 2 +- src/pages/CreateTenantWizard.tsx | 6 +++--- src/pages/Users.tsx | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hooks/useTenantTheme.ts b/src/hooks/useTenantTheme.ts index f662eb3..0060135 100644 --- a/src/hooks/useTenantTheme.ts +++ b/src/hooks/useTenantTheme.ts @@ -8,7 +8,7 @@ import { fetchThemeAsync } from '@/store/themeSlice'; */ export const useTenantTheme = (): void => { const dispatch = useAppDispatch(); - const { theme, faviconUrl, isInitialized, isLoading } = useAppSelector((state) => state.theme); + const { faviconUrl, isInitialized, isLoading } = useAppSelector((state) => state.theme); useEffect(() => { // Only fetch if not already initialized diff --git a/src/pages/CreateTenantWizard.tsx b/src/pages/CreateTenantWizard.tsx index 9d091e2..65c323d 100644 --- a/src/pages/CreateTenantWizard.tsx +++ b/src/pages/CreateTenantWizard.tsx @@ -204,7 +204,7 @@ const CreateTenantWizard = (): ReactElement => { const host = baseUrlObj.host; // e.g., "localhost:5173" const protocol = baseUrlObj.protocol; // e.g., "http:" or "https:" const autoGeneratedDomain = `${protocol}//${slug}.${host}/tenant`; - tenantDetailsForm.setValue('domain', autoGeneratedDomain, { shouldValidate: false }); + tenantDetailsForm.setValue('domain', autoGeneratedDomain, { shouldValidate: false }); } catch { // Fallback if URL parsing fails const autoGeneratedDomain = `${baseUrlWithProtocol.replace(/\/$/, '')}/${slug}/tenant`; @@ -323,8 +323,8 @@ const CreateTenantWizard = (): ReactElement => { primary_color: primary_color || undefined, secondary_color: secondary_color || undefined, accent_color: accent_color || undefined, - logo_file_path: logoFileUrl || undefined, - favicon_file_path: faviconFileUrl || undefined, + logo_file_path: logoFilePath || undefined, + favicon_file_path: faviconFilePath || undefined, }, }, }; diff --git a/src/pages/Users.tsx b/src/pages/Users.tsx index 1f32790..0e948d0 100644 --- a/src/pages/Users.tsx +++ b/src/pages/Users.tsx @@ -119,7 +119,6 @@ const Users = (): ReactElement => { last_name: string; status: 'active' | 'suspended' | 'deleted'; auth_provider: 'local'; - tenant_id: string; role_id: string; }): Promise => { try {