-
Failed to load class detections.
+
Failed to load detections.
The review screen uses the detection API for its queue and
evidence.
@@ -233,7 +227,7 @@ export default function TicketClassReviewPage() {
No detections found.
- There are no {defectClass} issues available for review.
+ There are no issues available for review.
diff --git a/src/app/(modules)/ticket/hooks/useTicketQueries.ts b/src/app/(modules)/ticket/hooks/useTicketQueries.ts
index 0cb5ee4..015f9f8 100644
--- a/src/app/(modules)/ticket/hooks/useTicketQueries.ts
+++ b/src/app/(modules)/ticket/hooks/useTicketQueries.ts
@@ -189,22 +189,16 @@ export function useTicketClassDetectionsQuery(
return useTicketDetectionsQuery(videoId, params);
}
-export function useTicketClassReviewDetectionsQuery(
+export function useTicketReviewDetectionsQuery(
videoId: string | undefined,
- defectClass: string | undefined,
proofStatus?: DetectionProofStatus,
) {
const pageSize = 20;
return useInfiniteQuery({
- queryKey: ticketKeys.classReviewDetections(
- videoId ?? '',
- defectClass ?? '',
- proofStatus,
- ),
+ queryKey: ticketKeys.reviewDetections(videoId ?? '', proofStatus),
queryFn: ({ pageParam }) =>
videoService.getVideoDetections(videoId as string, {
- class_name: defectClass,
proof_status: proofStatus,
sort: 'timestamp_asc',
skip: pageParam,
@@ -215,7 +209,7 @@ export function useTicketClassReviewDetectionsQuery(
const nextSkip = lastPage.skip + lastPage.items.length;
return nextSkip < lastPage.total ? nextSkip : undefined;
},
- enabled: Boolean(videoId && defectClass),
+ enabled: Boolean(videoId),
});
}
@@ -269,11 +263,9 @@ export function useDiscardDetectionMutation(
export function useReviewDetectionRepairProofMutation({
ticketId,
videoId,
- defectClass,
}: {
ticketId: string;
videoId: string | undefined;
- defectClass: string;
}) {
const queryClient = useQueryClient();
@@ -298,9 +290,6 @@ export function useReviewDetectionRepairProofMutation({
queryKey: ticketKeys.classDetectionLists(videoId),
})
: Promise.resolve(),
- queryClient.invalidateQueries({
- queryKey: ticketKeys.classDetail(ticketId, defectClass),
- }),
queryClient.invalidateQueries({
queryKey: ticketKeys.defectClasses(ticketId),
}),
diff --git a/src/app/(modules)/ticket/queries/ticketKeys.ts b/src/app/(modules)/ticket/queries/ticketKeys.ts
index 73da6a0..cad008c 100644
--- a/src/app/(modules)/ticket/queries/ticketKeys.ts
+++ b/src/app/(modules)/ticket/queries/ticketKeys.ts
@@ -26,15 +26,10 @@ export const ticketKeys = {
] as const,
detectionCoordinates: (videoId: string, params: DetectionCoordinatesParams) =>
[...ticketKeys.detectionCoordinateLists(videoId), params] as const,
- classReviewDetections: (
- videoId: string,
- defectClass: string,
- proofStatus?: string,
- ) =>
+ reviewDetections: (videoId: string, proofStatus?: string) =>
[
...ticketKeys.classDetectionLists(videoId),
- 'class-review',
- defectClass,
+ 'review',
proofStatus ?? 'all',
] as const,
defectClasses: (ticketId: string) =>
diff --git a/src/utils/routes.ts b/src/utils/routes.ts
index 197c753..89f2d1e 100644
--- a/src/utils/routes.ts
+++ b/src/utils/routes.ts
@@ -17,6 +17,5 @@ export const ROUTES = {
TICKET: '/ticket',
TICKET_DETAIL: (ticketId: string) => `/ticket/${ticketId}`,
TICKET_ASSIGN: (ticketId: string) => `/ticket/${ticketId}/assign`,
- TICKET_CLASS_REVIEW: (ticketId: string, defectClass: string) =>
- `/ticket/${ticketId}/${defectClass}/review`,
+ TICKET_REVIEW: (ticketId: string) => `/ticket/${ticketId}/review`,
} as const;