feat(ticket): support criteria-based global ticket assignment
This commit is contained in:
@@ -131,9 +131,10 @@ export function useDetectionCoordinatesQuery(
|
||||
() => ({
|
||||
limit: params.limit ?? 50,
|
||||
class_name: params.class_name,
|
||||
assignment_status: params.assignment_status,
|
||||
search: params.search,
|
||||
}),
|
||||
[params.class_name, params.limit, params.search],
|
||||
[params.assignment_status, params.class_name, params.limit, params.search],
|
||||
);
|
||||
|
||||
return useInfiniteQuery({
|
||||
@@ -320,7 +321,7 @@ function mergeTicketDetailResponse(
|
||||
};
|
||||
}
|
||||
|
||||
export function useAssignTicketMutation(ticketId: string) {
|
||||
export function useAssignTicketMutation(ticketId: string, videoId?: string) {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
@@ -330,9 +331,19 @@ export function useAssignTicketMutation(ticketId: string) {
|
||||
toast.success('Ticket assigned');
|
||||
await Promise.all([
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [...ticketKeys.details(), ticketId],
|
||||
queryKey: ticketKeys.overview(ticketId),
|
||||
}),
|
||||
queryClient.invalidateQueries({ queryKey: ticketKeys.lists() }),
|
||||
...(videoId
|
||||
? [
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ticketKeys.classDetectionLists(videoId),
|
||||
}),
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ticketKeys.detectionCoordinateLists(videoId),
|
||||
}),
|
||||
]
|
||||
: []),
|
||||
]);
|
||||
},
|
||||
onError: () => toast.error('Failed to assign ticket'),
|
||||
|
||||
Reference in New Issue
Block a user