Skip to content

Commit

Permalink
Merge pull request #973 from hpcc-systems/yadhap/unapprove-JM-after-u…
Browse files Browse the repository at this point in the history
…pdate

Updating ApprovalStatus to Pending and activeStatus to false when job…
  • Loading branch information
FancMa01 authored Dec 10, 2024
2 parents a29b51c + 900dd0d commit e375d21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const BulkUpdateModal = ({
selectedRows.forEach((row) => {
const { metaData } = row || {};
const { notificationMetaData } = metaData || {};
const { primaryContacts, secondaryContacts, notifyContacts } = notificationMetaData || {};
const { primaryContacts = [], secondaryContacts = [], notifyContacts = [] } = notificationMetaData || {};

let meta = {};

Expand Down Expand Up @@ -169,7 +169,7 @@ const BulkUpdateModal = ({
const newJobMonitoringData = jobMonitorings.map((job) => {
if (allUpdatedIds.includes(job.id)) {
const updatedJob = updatedMetaData.find((data) => data.id === job.id);
return { ...job, metaData: updatedJob.metaData };
return { ...job, metaData: updatedJob.metaData, isActive: false, approvalStatus: 'Pending' };
}
return job;
});
Expand All @@ -178,7 +178,7 @@ const BulkUpdateModal = ({
setSelectedRows((prev) =>
prev.map((row) => {
const updatedRow = updatedMetaData.find((data) => data.id === row.id);
return { ...row, metaData: updatedRow.metaData };
return { ...row, metaData: updatedRow.metaData, isActive: false, approvalStatus: 'Pending' };
})
);

Expand Down
3 changes: 2 additions & 1 deletion Tombolo/server/routes/jobmonitoring/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,13 @@ router.patch(
}

try {

const {metaData: payload} = req.body;

for(const data of payload){
await JobMonitoring.update({
metaData: data.metaData,
isActive: false,
approvalStatus: "Pending",
},{
where: {id: data.id}
});
Expand Down

0 comments on commit e375d21

Please sign in to comment.