mariana-marcal-santana commented on code in PR #51264:
URL: https://github.com/apache/airflow/pull/51264#discussion_r2134857892


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py:
##########
@@ -54,23 +54,45 @@
 from airflow.api_fastapi.core_api.datamodels.dags import (
     DAGCollectionResponse,
     DAGDetailsResponse,
+    DAGFavoriteBody,
     DAGPatchBody,
     DAGResponse,
 )
 from airflow.api_fastapi.core_api.openapi.exceptions import 
create_openapi_http_exception_doc
 from airflow.api_fastapi.core_api.security import (
     EditableDagsFilterDep,
+    GetUserDep,
     ReadableDagsFilterDep,
     requires_access_dag,
 )
 from airflow.api_fastapi.logging.decorators import action_logging
 from airflow.exceptions import AirflowException, DagNotFound
 from airflow.models import DAG, DagModel
+from airflow.models.dag_favorite import DagFavorite
 from airflow.models.dagrun import DagRun
 
 dags_router = AirflowRouter(tags=["DAG"], prefix="/dags")
 
 
+@dags_router.get("/favorite", 
dependencies=[Depends(requires_access_dag(method="GET"))])

Review Comment:
   > not sure about `dags/favorite` maybe that should be on it's own root path 
`/favorites`. (also always plural). Or even better, maybe just a filter option 
in the `get_dags` endpoint (probably only the UI one). `favorite: true/false`. 
So we can beneficiate from the full features of the get_dags endpoint but also 
on favorites. (for instance GET all the favorite dags with a dag_id_pattern 
that is .... ordering_by something else)
   > 
   > Maybe that sould be actions on the dag. `dags/{dag_id}/favorite` 
`dags/{dag_id}/unfavorite`. (POST on both) So we don't even need a body. To 
mark a dag as favorite or unfavorite.
   
   @pierrejeambrun 
   
   The suggested changes are in our latest commit. 
   Could you give us some feedback if possible?
   
   Thank you



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to