debug: add console logging to handleStatusClick and updateMutation onError
This commit is contained in:
@@ -85,6 +85,9 @@ export function AdminTestChecklistPage() {
|
|||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
queryClient.invalidateQueries({ queryKey: ['admin', 'test-checklist'] })
|
queryClient.invalidateQueries({ queryKey: ['admin', 'test-checklist'] })
|
||||||
},
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
console.warn('updateTestChecklistItem error:', error)
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const resetMutation = useMutation({
|
const resetMutation = useMutation({
|
||||||
@@ -112,15 +115,14 @@ export function AdminTestChecklistPage() {
|
|||||||
|
|
||||||
const handleStatusClick = useCallback(
|
const handleStatusClick = useCallback(
|
||||||
(itemKey: string) => {
|
(itemKey: string) => {
|
||||||
|
console.warn('handleStatusClick:', itemKey, results[itemKey])
|
||||||
const current = statusFromResult(results[itemKey])
|
const current = statusFromResult(results[itemKey])
|
||||||
|
console.warn('current status:', current)
|
||||||
if (current === 'failed') {
|
if (current === 'failed') {
|
||||||
// Clicking on failed → reset to unchecked
|
|
||||||
updateMutation.mutate({ itemKey, passed: false, comment: null })
|
updateMutation.mutate({ itemKey, passed: false, comment: null })
|
||||||
} else if (current === 'unchecked') {
|
} else if (current === 'unchecked') {
|
||||||
// Clicking on unchecked → mark as passed
|
|
||||||
updateMutation.mutate({ itemKey, passed: true })
|
updateMutation.mutate({ itemKey, passed: true })
|
||||||
} else {
|
} else {
|
||||||
// Clicking on passed → open error dialog
|
|
||||||
setErrorItemKey(itemKey)
|
setErrorItemKey(itemKey)
|
||||||
setErrorComment('')
|
setErrorComment('')
|
||||||
setErrorCommentError(false)
|
setErrorCommentError(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user