fix: allow null comment in server validation, remove debug logging
This commit is contained in:
@@ -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 символов)' })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user