Skip to content

Commit

Permalink
[MDS-5379] db error in final application page (#2593)
Browse files Browse the repository at this point in the history
fix to make optional params in mine document endpoint not be passed null values
  • Loading branch information
asinn134 authored Jul 21, 2023
1 parent 53d3267 commit 23a3c39
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
Expand Down

0 comments on commit 23a3c39

Please sign in to comment.