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 = {
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user