diff --git a/src/chart/table/TableChart.tsx b/src/chart/table/TableChart.tsx index b08530736..4b508c202 100644 --- a/src/chart/table/TableChart.tsx +++ b/src/chart/table/TableChart.tsx @@ -129,6 +129,7 @@ export const NeoTableChart = (props: ChartProps) => { } const { records } = props; + const isApiSpecEnabled = props.settings?.apiSpec && props.settings?.apiSpec.apiEnabled; const generateSafeColumnKey = (key) => { return key != 'id' ? key : `${key} `; @@ -346,6 +347,12 @@ export const NeoTableChart = (props: ChartProps) => { props.updateReportSetting('apiSpec', { ...props.settings?.apiSpec, response: null }); }; + useEffect(() => { + if (isApiSpecEnabled) { + handleResetApiResponse(); + } + }, [records]); + const apiCallButton = () => ( )} - - - {props.settings?.apiSpec.response ? ( { ); - const isApiSpecEnabled = props.settings?.apiSpec && props.settings?.apiSpec.apiEnabled; - const tableStyle: any = isApiSpecEnabled ? { marginTop: 10, height: '90%', width: '100%', position: 'relative' } : { height: '100%', width: '100%', position: 'relative' };