You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/06 19:24:35 UTC

[GitHub] [superset] eschutho commented on a diff in pull request #19434: feat: deprecate old API and create new API for dashes created by me

eschutho commented on code in PR #19434:
URL: https://github.com/apache/superset/pull/19434#discussion_r844315292


##########
superset/dashboards/api.py:
##########
@@ -455,6 +453,43 @@ def get_charts(self, id_or_slug: str) -> Response:
         except DashboardNotFoundError:
             return self.response_404()
 
+    @expose("/created_by_me/", methods=["GET"])
+    @protect()
+    @safe
+    @statsd_metrics
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.get",
+        log_to_statsd=False,
+    )
+    def created_by_me(self) -> Response:
+        """Gets all dashboards created by the current user
+        ---
+        get:
+          description: >-
+            Gets all dashboards created by the current user
+          responses:
+            200:
+              description: Dashboard
+              content:
+                application/json:
+                  schema:
+                    type: object
+                    properties:
+                      result:
+                        type: array
+                        items:
+                          $ref: '#/components/schemas/DashboardCreatedByMeResponseSchema'
+            401:
+              $ref: '#/components/responses/401'
+            403:
+              $ref: '#/components/responses/403'
+            404:
+              $ref: '#/components/responses/404'
+        """
+        dashboards = DashboardDAO.get_dashboards_created_by(g.user.id)

Review Comment:
   Sort of a similar question, but would it be possible to use the existing resource name of "dashboards" and just use a query string and create a filter for this endpoint instead of a new one? Just thinking along the lines of how can we make this more restful.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org