Skip to content

Commit 2269dae

Browse files
leSamokpatticha
authored and
kpatticha
committed
fix: Make status change twice as fast
1 parent b36101b commit 2269dae

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/Components/SmartComponents/Modals/CveStatusModal.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,20 @@ export const CveStatusModal = ({ cves, updateRef, intl }) => {
2020
}, [setSelectProps]);
2121

2222
const handleSave = () => {
23-
return setCveStatus({
24-
status_id: parseInt(statusId),
25-
cve: cveList.map(item => item.id),
26-
status_text: justification
27-
})
28-
.then(() => (!checkboxState && cvesWithExposedSystems.length > 0)
29-
? setSystemCveStatus({ cve: cvesWithExposedSystems }) : true)
23+
return Promise.all([
24+
setCveStatus({
25+
cve: cveList.map(item => item.id),
26+
status_id: parseInt(statusId),
27+
status_text: justification
28+
}),
29+
...[(!checkboxState && cvesWithExposedSystems.length > 0) &&
30+
setSystemCveStatus({
31+
cve: cvesWithExposedSystems,
32+
status_id: parseInt(statusId),
33+
status_text: justification
34+
})
35+
]
36+
])
3037
.then(updateRef)
3138
.catch(error => { throw error; }); // propagate error to BaseModal
3239
};

0 commit comments

Comments
 (0)