This is an automated email from the ASF dual-hosted git repository.
pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 0d30fb5afc0 UI - Fix test connection (#57811)
0d30fb5afc0 is described below
commit 0d30fb5afc064f20d95a803f5b0580861255cd82
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Wed Nov 5 10:38:06 2025 +0100
UI - Fix test connection (#57811)
---
airflow-core/src/airflow/ui/src/queries/useTestConnection.ts | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
b/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
index f68b3c5d562..e31936a0ab3 100644
--- a/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
+++ b/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
@@ -16,21 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { useQueryClient } from "@tanstack/react-query";
import type { Dispatch, SetStateAction } from "react";
-import { useConnectionServiceTestConnection,
useConnectionServiceGetConnectionsKey } from "openapi/queries";
+import { useConnectionServiceTestConnection } from "openapi/queries";
import type { ConnectionTestResponse } from "openapi/requests/types.gen";
export const useTestConnection = (setConnected:
Dispatch<SetStateAction<boolean | undefined>>) => {
- const queryClient = useQueryClient();
-
- const onSuccess = async (res: ConnectionTestResponse) => {
- await queryClient.invalidateQueries({
- queryKey: [useConnectionServiceGetConnectionsKey],
- });
- setConnected(res.status);
- };
+ const onSuccess = (res: ConnectionTestResponse) => setConnected(res.status);
const onError = () => {
setConnected(false);