From 80e3cd1b30294dff292ec38732af6a6774cba851 Mon Sep 17 00:00:00 2001 From: Kirill Date: Sun, 24 May 2026 17:06:07 +0500 Subject: [PATCH] fix: allow null comment in server validation, remove debug logging --- .../pages/admin-test-checklist/ui/AdminTestChecklistPage.tsx | 5 ----- server/src/routes/api/admin/test-checklist.js | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) 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 символов)' }) }