diff --git a/services/core-web/src/components/mine/Projects/DecisionPackageTab.js b/services/core-web/src/components/mine/Projects/DecisionPackageTab.js index 15c9ee295f..050c22fd56 100644 --- a/services/core-web/src/components/mine/Projects/DecisionPackageTab.js +++ b/services/core-web/src/components/mine/Projects/DecisionPackageTab.js @@ -73,10 +73,12 @@ export class DecisionPackageTab extends Component { handleFetchData = async () => { const { projectGuid } = this.props.match?.params; const project = await this.props.fetchProjectById(projectGuid); - await this.props.fetchMineDocuments(project.mine_guid, { is_archived: true, - project_decision_package_guid: project.project_decision_package.project_decision_package_guid, + ...(project?.project_decision_package?.project_decision_package_guid && { + project_decision_package_guid: + project?.project_decision_package?.project_decision_package_guid, + }), }); }; diff --git a/services/core-web/src/components/mine/Projects/MajorMineApplicationTab.js b/services/core-web/src/components/mine/Projects/MajorMineApplicationTab.js index 168fd3f390..737cb62af1 100644 --- a/services/core-web/src/components/mine/Projects/MajorMineApplicationTab.js +++ b/services/core-web/src/components/mine/Projects/MajorMineApplicationTab.js @@ -85,7 +85,9 @@ export class MajorMineApplicationTab extends Component { const project = await this.props.fetchProjectById(projectGuid); this.props.fetchMineDocuments(project.mine_guid, { is_archived: true, - major_mine_application_guid: project?.major_mine_application?.major_mine_application_guid, + ...(project?.major_mine_application?.major_mine_application_guid && { + major_mine_application_guid: project?.major_mine_application?.major_mine_application_guid, + }), }); } diff --git a/services/minespace-web/src/components/pages/Project/MajorMineApplicationPage.js b/services/minespace-web/src/components/pages/Project/MajorMineApplicationPage.js index 7f201024c9..5bec95421d 100644 --- a/services/minespace-web/src/components/pages/Project/MajorMineApplicationPage.js +++ b/services/minespace-web/src/components/pages/Project/MajorMineApplicationPage.js @@ -296,7 +296,9 @@ export class MajorMineApplicationPage extends Component { this.props.fetchMineDocuments(project.mine_guid, { is_archived: true, - major_mine_application_guid: project.major_mine_application?.major_mine_application_guid, + ...(project.major_mine_application?.major_mine_application_guid && { + major_mine_application_guid: project.major_mine_application?.major_mine_application_guid, + }), }); }; diff --git a/services/minespace-web/src/components/pages/Project/ProjectPage.js b/services/minespace-web/src/components/pages/Project/ProjectPage.js index ee076ce7e8..ac89b1dc3c 100644 --- a/services/minespace-web/src/components/pages/Project/ProjectPage.js +++ b/services/minespace-web/src/components/pages/Project/ProjectPage.js @@ -81,8 +81,10 @@ export class ProjectPage extends Component { let filters = { project_guid: this.props?.project?.project_guid, is_archived: true }; if (activeTab == "major-mine-application") { filters = { - major_mine_application_guid: this.props?.project?.major_mine_application - ?.major_mine_application_guid, + ...(this.props?.project?.major_mine_application?.major_mine_application_guid && { + major_mine_application_guid: this.props?.project?.major_mine_application + ?.major_mine_application_guid, + }), is_archived: true, }; }