Fix react query cache key problem for saved tasks (#1518)
This commit is contained in:
@@ -16,7 +16,7 @@ function CreateNewTaskFormPage() {
|
|||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const { data, isFetching } = useQuery({
|
const { data, isFetching } = useQuery({
|
||||||
queryKey: ["savedTask", template],
|
queryKey: ["savedTasks", template],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const client = await getClient(credentialGetter);
|
const client = await getClient(credentialGetter);
|
||||||
return client
|
return client
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ function SavedTaskForm({ initialValues }: Props) {
|
|||||||
description: "Changes saved successfully",
|
description: "Changes saved successfully",
|
||||||
});
|
});
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: ["savedTasks", template],
|
queryKey: ["savedTasks"],
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user