fix: BUG-080/082 (20 unused frontend components deleted), BUG-083 (useTenant.ts deleted), BUG-011 (playwright baseURL), BUG-069 (unused python modules deleted), BUG-065 (already has eager loading), BUG-026 (already fixed 422), BUG-023 (no sync I/O found)
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import { useSwitchTenant } from '@/api/hooks';
|
||||
|
||||
export function useTenant() {
|
||||
const { user, currentTenant, setTenant } = useAuthStore();
|
||||
const switchTenantMutation = useSwitchTenant();
|
||||
|
||||
const availableTenants = user?.tenants ?? [];
|
||||
|
||||
const switchTenant = async (tenantId: string) => {
|
||||
try {
|
||||
await switchTenantMutation.mutateAsync(tenantId);
|
||||
} catch (error) {
|
||||
console.error('Failed to switch tenant:', error);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
currentTenant,
|
||||
availableTenants,
|
||||
switchTenant,
|
||||
isSwitching: switchTenantMutation.isPending,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user