From fe081bdc75d1a49b1e92c780d0da9f8c27f2248f Mon Sep 17 00:00:00 2001 From: Sujit Date: Mon, 4 Nov 2024 16:54:00 +0545 Subject: [PATCH] feat(task-description): update status on rerun processing --- .../DescriptionSection/DescriptionBox/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/components/DroneOperatorTask/DescriptionSection/DescriptionBox/index.tsx b/src/frontend/src/components/DroneOperatorTask/DescriptionSection/DescriptionBox/index.tsx index 92e8d023..eeb12e07 100644 --- a/src/frontend/src/components/DroneOperatorTask/DescriptionSection/DescriptionBox/index.tsx +++ b/src/frontend/src/components/DroneOperatorTask/DescriptionSection/DescriptionBox/index.tsx @@ -48,6 +48,9 @@ const DescriptionBox = () => { const { mutate: updateStatus } = useMutation({ mutationFn: postTaskStatus, + onSuccess: () => { + queryClient.invalidateQueries(['task-assets-info']); + }, onError: (err: any) => { toast.error(err.message); }, @@ -61,7 +64,6 @@ const DescriptionBox = () => { taskId, data: { event: 'image_upload', updated_at: new Date().toISOString() }, }); - queryClient.invalidateQueries(['task-assets-info']); toast.success('Image processing re-started'); }, });