diff --git a/src/components/manage/Blocks/DefaultView.jsx b/src/components/manage/Blocks/DefaultView.jsx index 1052a2d2..bd98f4de 100644 --- a/src/components/manage/Blocks/DefaultView.jsx +++ b/src/components/manage/Blocks/DefaultView.jsx @@ -20,9 +20,9 @@ const DefaultView = props => { const providerUrl = data?.providerUrl || settings.providerUrl || null; useEffect(() => { if ( - selectQuery.table && - selectQuery.columnKey && - selectQuery.columnValue && + selectQuery?.table && + selectQuery?.columnKey && + selectQuery?.columnValue && providerUrl && !state.loading ) { diff --git a/src/components/manage/Blocks/FacilityBlock/View.jsx b/src/components/manage/Blocks/FacilityBlock/View.jsx index dd4f6cd4..8f78ec11 100644 --- a/src/components/manage/Blocks/FacilityBlock/View.jsx +++ b/src/components/manage/Blocks/FacilityBlock/View.jsx @@ -28,23 +28,27 @@ const View = props => {
Industrial activity
-{state.items[0]?.mainActivity}
+{state.items?.[0]?.mainActivity}
Last report was submitted on:
- {moment(state.items[0]?.eprtrReportingDate).format('DD MMM YYYY')} + {moment(state.items?.[0]?.eprtrReportingDate).format( + 'DD MMM YYYY', + )}
Reporting year
-{state.items[0]?.eprtrReportingYear}
+{state.items?.[0]?.eprtrReportingYear}
Publish date
- {moment(state.items[0]?.eprtrReportingDate).format('DD MMM YYYY')} + {moment(state.items?.[0]?.eprtrReportingDate).format( + 'DD MMM YYYY', + )}
Last updated:{' '} - {moment(state.items[0]?.authLastUpdated).format('DD MMM YYYY')} + {moment(state.items?.[0]?.authLastUpdated).format('DD MMM YYYY')}
{meta.label}
-{state.items[0]?.[meta.id]}
+{state.items?.[0]?.[meta.id]}