feat: add measured detection review loop
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
import { apiGet, apiPost } from './client'
|
||||
import type { QaComparisonRequest, JobRead, QualityCheckListResponse, QualityEvidenceGeoJsonResponse } from '../../types'
|
||||
import type {
|
||||
DetectionReviewList,
|
||||
DetectionReviewRead,
|
||||
DetectionReviewUpsert,
|
||||
JobRead,
|
||||
QaComparisonRequest,
|
||||
QualityCheckListResponse,
|
||||
QualityEvidenceGeoJsonResponse,
|
||||
} from '../../types'
|
||||
|
||||
export const qaApi = {
|
||||
runQa: (payload: QaComparisonRequest): Promise<JobRead> =>
|
||||
@@ -8,4 +16,23 @@ export const qaApi = {
|
||||
apiGet<QualityCheckListResponse>(`/api/v1/projects/${projectId}/quality-checks`),
|
||||
getQualityEvidenceGeoJson: (projectId: string, qualityCheckId: string): Promise<QualityEvidenceGeoJsonResponse> =>
|
||||
apiGet<QualityEvidenceGeoJsonResponse>(`/api/v1/projects/${projectId}/quality-checks/${qualityCheckId}/evidence/geojson`),
|
||||
listDetectionReviews: (
|
||||
projectId: string,
|
||||
qualityCheckId: string,
|
||||
options: { evidenceRole?: string; reviewed?: boolean; limit?: number; offset?: number } = {},
|
||||
): Promise<DetectionReviewList> => {
|
||||
const query = new URLSearchParams({
|
||||
limit: String(options.limit ?? 50),
|
||||
offset: String(options.offset ?? 0),
|
||||
})
|
||||
if (options.evidenceRole) query.set('evidence_role', options.evidenceRole)
|
||||
if (typeof options.reviewed === 'boolean') query.set('reviewed', String(options.reviewed))
|
||||
return apiGet<DetectionReviewList>(`/api/v1/projects/${projectId}/quality-checks/${qualityCheckId}/reviews?${query}`)
|
||||
},
|
||||
upsertDetectionReview: (
|
||||
projectId: string,
|
||||
qualityCheckId: string,
|
||||
payload: DetectionReviewUpsert,
|
||||
): Promise<DetectionReviewRead> =>
|
||||
apiPost<DetectionReviewRead>(`/api/v1/projects/${projectId}/quality-checks/${qualityCheckId}/reviews`, payload),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user