fix: allow null comment in server validation, remove debug logging

This commit is contained in:
Kirill
2026-05-24 17:06:07 +05:00
parent 8474ee0f80
commit 80e3cd1b30
2 changed files with 2 additions and 7 deletions
@@ -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 символов)' })
}