Обновления системы после анализа и оптимизации архитектуры
- Обновлена схема 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:
@ -21,11 +21,7 @@ const handler = startServerAndCreateNextHandler<NextRequest, Context>(server, {
|
||||
const authHeader = req.headers.get('authorization')
|
||||
const token = authHeader?.replace('Bearer ', '')
|
||||
|
||||
console.warn('GraphQL Context - Auth header:', authHeader)
|
||||
console.warn('GraphQL Context - Token:', token ? `${token.substring(0, 20)}...` : 'No token')
|
||||
|
||||
if (!token) {
|
||||
console.warn('GraphQL Context - No token provided')
|
||||
return { user: null, admin: null, prisma }
|
||||
}
|
||||
|
||||
@ -46,10 +42,6 @@ const handler = startServerAndCreateNextHandler<NextRequest, Context>(server, {
|
||||
|
||||
// Проверяем тип токена
|
||||
if (decoded.type === 'admin' && decoded.adminId && decoded.username) {
|
||||
console.warn('GraphQL Context - Decoded admin:', {
|
||||
id: decoded.adminId,
|
||||
username: decoded.username,
|
||||
})
|
||||
return {
|
||||
admin: {
|
||||
id: decoded.adminId,
|
||||
@ -59,10 +51,6 @@ const handler = startServerAndCreateNextHandler<NextRequest, Context>(server, {
|
||||
prisma,
|
||||
}
|
||||
} else if (decoded.userId && decoded.phone) {
|
||||
console.warn('GraphQL Context - Decoded user:', {
|
||||
id: decoded.userId,
|
||||
phone: decoded.phone,
|
||||
})
|
||||
return {
|
||||
user: {
|
||||
id: decoded.userId,
|
||||
|
Reference in New Issue
Block a user