diff --git a/client/src/pages/admin-test-checklist/ui/AdminTestChecklistPage.tsx b/client/src/pages/admin-test-checklist/ui/AdminTestChecklistPage.tsx index d0156cf..795510c 100644 --- a/client/src/pages/admin-test-checklist/ui/AdminTestChecklistPage.tsx +++ b/client/src/pages/admin-test-checklist/ui/AdminTestChecklistPage.tsx @@ -85,9 +85,6 @@ export function AdminTestChecklistPage() { onSuccess: () => { queryClient.invalidateQueries({ queryKey: ['admin', 'test-checklist'] }) }, - onError: (error) => { - console.warn('updateTestChecklistItem error:', error) - }, }) const resetMutation = useMutation({ @@ -115,9 +112,7 @@ export function AdminTestChecklistPage() { const handleStatusClick = useCallback( (itemKey: string) => { - console.warn('handleStatusClick:', itemKey, results[itemKey]) const current = statusFromResult(results[itemKey]) - console.warn('current status:', current) if (current === 'failed') { updateMutation.mutate({ itemKey, passed: false, comment: null }) } else if (current === 'unchecked') { diff --git a/server/src/routes/api/admin/test-checklist.js b/server/src/routes/api/admin/test-checklist.js index cfd5e00..5035548 100644 --- a/server/src/routes/api/admin/test-checklist.js +++ b/server/src/routes/api/admin/test-checklist.js @@ -15,10 +15,10 @@ export async function registerAdminTestChecklistRoutes(fastify) { if (!itemKey || typeof passed !== 'boolean') { return reply.code(400).send({ error: 'itemKey и passed (boolean) обязательны' }) } - if (comment !== undefined && typeof comment !== 'string') { + if (comment !== undefined && comment !== null && typeof comment !== 'string') { return reply.code(400).send({ error: 'comment должен быть строкой' }) } - if (comment !== undefined && comment.length > 2000) { + if (comment !== undefined && comment !== null && comment.length > 2000) { return reply.code(400).send({ error: 'Комментарий слишком длинный (макс. 2000 символов)' }) }