feat: add comment to test-checklist API client types and function

This commit is contained in:
Kirill
2026-05-24 16:53:59 +05:00
parent 42c83b5d4e
commit 19dd5f213c
@@ -2,6 +2,7 @@ import { apiClient } from '@/shared/api/client'
export type ChecklistResultDto = { export type ChecklistResultDto = {
passed: boolean passed: boolean
comment: string | null
checkedAt: string checkedAt: string
} }
@@ -12,6 +13,7 @@ export type TestChecklistResponse = {
export type UpdateChecklistItemResponse = { export type UpdateChecklistItemResponse = {
itemKey: string itemKey: string
passed: boolean passed: boolean
comment: string | null
checkedAt: string checkedAt: string
} }
@@ -20,10 +22,15 @@ export async function fetchTestChecklistResults(): Promise<TestChecklistResponse
return data return data
} }
export async function updateTestChecklistItem(itemKey: string, passed: boolean): Promise<UpdateChecklistItemResponse> { export async function updateTestChecklistItem(
itemKey: string,
passed: boolean,
comment?: string | null,
): Promise<UpdateChecklistItemResponse> {
const { data } = await apiClient.patch<{ result: UpdateChecklistItemResponse }>('admin/test-checklist', { const { data } = await apiClient.patch<{ result: UpdateChecklistItemResponse }>('admin/test-checklist', {
itemKey, itemKey,
passed, passed,
comment: passed ? null : comment ?? null,
}) })
return data.result return data.result
} }