Обновления системы после анализа и оптимизации архитектуры

- Обновлена схема Prisma с новыми полями и связями
- Актуализированы правила системы в rules-complete.md
- Оптимизированы GraphQL типы, запросы и мутации
- Улучшены компоненты интерфейса и валидация данных
- Исправлены критические ESLint ошибки: удалены неиспользуемые импорты и переменные
- Добавлены тестовые файлы для проверки функционала

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Veronika Smirnova
2025-08-06 23:44:49 +03:00
parent c2b342a527
commit 10af6f08cc
33 changed files with 3259 additions and 1319 deletions

View File

@ -19,29 +19,17 @@ export function AuthGuard({ children, fallback }: AuthGuardProps) {
useEffect(() => {
const initAuth = async () => {
if (initRef.current) {
console.warn('AuthGuard - Already initialized, skipping')
return
}
initRef.current = true
console.warn('AuthGuard - Initializing auth check')
await checkAuth()
setIsChecking(false)
console.warn('AuthGuard - Auth check completed, authenticated:', isAuthenticated, 'user:', !!user)
}
initAuth()
}, [checkAuth, isAuthenticated, user]) // Добавляем зависимости как требует линтер
// Дополнительное логирование состояний
useEffect(() => {
console.warn('AuthGuard - State update:', {
isChecking,
isLoading,
isAuthenticated,
hasUser: !!user,
})
}, [isChecking, isLoading, isAuthenticated, user])
// Показываем лоадер пока проверяем авторизацию
if (isChecking || isLoading) {
@ -57,11 +45,9 @@ export function AuthGuard({ children, fallback }: AuthGuardProps) {
// Если не авторизован, показываем форму авторизации
if (!isAuthenticated) {
console.warn('AuthGuard - User not authenticated, showing auth flow')
return fallback || <AuthFlow />
}
// Если авторизован, показываем защищенный контент
console.warn('AuthGuard - User authenticated, showing dashboard')
return <>{children}</>
}