debug: add console logging to handleStatusClick and updateMutation onError

This commit is contained in:
Kirill
2026-05-24 17:04:31 +05:00
parent c81b7b1e2d
commit 8474ee0f80
@@ -85,6 +85,9 @@ export function AdminTestChecklistPage() {
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['admin', 'test-checklist'] })
},
onError: (error) => {
console.warn('updateTestChecklistItem error:', error)
},
})
const resetMutation = useMutation({
@@ -112,15 +115,14 @@ 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') {
// Clicking on failed → reset to unchecked
updateMutation.mutate({ itemKey, passed: false, comment: null })
} else if (current === 'unchecked') {
// Clicking on unchecked → mark as passed
updateMutation.mutate({ itemKey, passed: true })
} else {
// Clicking on passed → open error dialog
setErrorItemKey(itemKey)
setErrorComment('')
setErrorCommentError(false)