diff --git a/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx b/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx index ef3153876c37f..f0ea76cf87cef 100644 --- a/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx +++ b/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx @@ -164,6 +164,7 @@ const createColumns = ( header: "", }, { + accessorKey: "favourite", cell: ({ row: { original } }) => ( ), diff --git a/airflow-core/src/airflow/ui/src/queries/useToggleFavoriteDag.ts b/airflow-core/src/airflow/ui/src/queries/useToggleFavoriteDag.ts index d3cfaa7cf0c2d..6093177a64d59 100644 --- a/airflow-core/src/airflow/ui/src/queries/useToggleFavoriteDag.ts +++ b/airflow-core/src/airflow/ui/src/queries/useToggleFavoriteDag.ts @@ -35,10 +35,13 @@ export const useToggleFavoriteDag = (dagId: string) => { queryKey: [useDagServiceGetDagsUiKey, UseDagServiceGetDagDetailsKeyFn({ dagId }, [{ dagId }])], }); - // Invalidate the specific DAG details query for this DAG - await queryClient.invalidateQueries({ - queryKey: UseDagServiceGetDagDetailsKeyFn({ dagId }, [{ dagId }]), - }); + const queryKeys = [ + // Invalidate the specific DAG details query for this DAG and DAGs list query. + UseDagServiceGetDagDetailsKeyFn({ dagId }, [{ dagId }]), + [useDagServiceGetDagsUiKey], + ]; + + await Promise.all(queryKeys.map((key) => queryClient.invalidateQueries({ queryKey: key }))); }, [queryClient, dagId]); const favoriteMutation = useDagServiceFavoriteDag({