nytai commented on a change in pull request #10510:
URL:
https://github.com/apache/incubator-superset/pull/10510#discussion_r465241504
##########
File path: superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx
##########
@@ -106,6 +110,61 @@ class DashboardList extends React.PureComponent<Props,
State> {
initialSort = [{ id: 'changed_on_delta_humanized', desc: true }];
columns = [
+ {
+ Cell: ({ row: { original } }: any) => {
+ // TODO: return null if no user is logged in
+ const fetchFaveStar = (id: number) => {
+ SupersetClient.get({
+ endpoint: `${FAVESTAR_BASE_URL}/${id}/count/`,
+ })
+ .then(({ json }) => {
+ const faves = {
+ ...this.state.favoriteStatus,
+ };
+
+ faves[id] = json.count > 0;
+
+ this.setState({
+ favoriteStatus: faves,
+ });
+ })
+ .catch(() => {});
Review comment:
let's handle this exception. Swallowed exceptions make debugging very
difficult. There should be other examples of handling promise errors in this
component.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]