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 2021/01/05 23:01:57 UTC

[GitHub] [superset] ktmud commented on a change in pull request #12230: chore: Removing datasets.ts file from codebase

ktmud commented on a change in pull request #12230:
URL: https://github.com/apache/superset/pull/12230#discussion_r552250230



##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -171,8 +200,24 @@ export default class ResultSet extends React.PureComponent<
       appContainer?.getAttribute('data-bootstrap') || '{}',
     );
 
-    const datasets = await getByUser(bootstrapData.user.userId);
-    const userDatasetsOwned = datasets.map(
+    const queryParams = rison.encode({
+      filters: [
+        {
+          col: 'owners',
+          opr: 'rel_m_m',
+          value: bootstrapData.user.userId,
+        },
+      ],
+      order_column: 'changed_on_delta_humanized',
+      order_direction: 'desc',
+    });
+
+    const response = await makeApi({
+      method: 'GET',
+      endpoint: `/api/v1/dataset?q=${queryParams}`,
+    })({});

Review comment:
       `makeApi` supports [`requestType: 'rison'`](https://github.com/airbnb/incubator-superset/blob/3fb4e5469041b439bd2bc036b8e060e8187025b5/superset-frontend/src/views/CRUD/alert/AlertList.tsx#L62). You don't have to encode the query params yourself.




----------------------------------------------------------------
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.

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