feat: add comment to test-checklist API client types and function
This commit is contained in:
@@ -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<TestChecklistResponse
|
||||
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', {
|
||||
itemKey,
|
||||
passed,
|
||||
comment: passed ? null : comment ?? null,
|
||||
})
|
||||
return data.result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user