- dashboardInfo might be an empty object, in which case we must use the chart info instead so the resourceId is not undefined
This commit is contained in:
Antonio Rivero Martinez 2022-07-27 15:33:13 -03:00 committed by GitHub
parent 234c44626d
commit 07ce33d142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import {
addDangerToast,
addSuccessToast,
} from 'src/components/MessageToasts/actions';
import { isEmpty } from 'lodash';
export const SET_REPORT = 'SET_REPORT';
export function setReport(report, resourceId, creationMethod, filterField) {
@ -76,7 +77,7 @@ export function fetchUISpecificReport({
const structureFetchAction = (dispatch, getState) => {
const state = getState();
const { user, dashboardInfo, charts, explore } = state;
if (dashboardInfo) {
if (!isEmpty(dashboardInfo)) {
dispatch(
fetchUISpecificReport({
userId: user.userId,
@ -89,7 +90,7 @@ const structureFetchAction = (dispatch, getState) => {
const [chartArr] = Object.keys(charts);
dispatch(
fetchUISpecificReport({
userId: explore.user.userId,
userId: explore.user?.userId || user?.userId,
filterField: 'chart_id',
creationMethod: 'charts',
resourceId: charts[chartArr].id,