diff --git a/client/src/entities/test-checklist/api/test-checklist-api.ts b/client/src/entities/test-checklist/api/test-checklist-api.ts index 8e8a5f3..988ccbd 100644 --- a/client/src/entities/test-checklist/api/test-checklist-api.ts +++ b/client/src/entities/test-checklist/api/test-checklist-api.ts @@ -2,6 +2,7 @@ import { apiClient } from '@/shared/api/client' export type ChecklistResultDto = { passed: boolean + comment: string | null checkedAt: string } @@ -12,6 +13,7 @@ export type TestChecklistResponse = { export type UpdateChecklistItemResponse = { itemKey: string passed: boolean + comment: string | null checkedAt: string } @@ -20,10 +22,15 @@ export async function fetchTestChecklistResults(): Promise { +export async function updateTestChecklistItem( + itemKey: string, + passed: boolean, + comment?: string | null, +): Promise { const { data } = await apiClient.patch<{ result: UpdateChecklistItemResponse }>('admin/test-checklist', { itemKey, passed, + comment: passed ? null : comment ?? null, }) return data.result }