Skip to content

Commit

Permalink
feat: add confirmation pop up before unlinking/deleting a stakeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynndp committed Jun 20, 2022
1 parent 0724065 commit 1f9e811
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/api/stakeholders.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export default {
getStakeholders(id, filter) {
const orgId = id || getOrganizationId();

console.log('getStakeholders', orgId, filter);

const where = Object.keys(filter).reduce((acc, key) => {
if (filter[key] !== '') {
acc += `&${key}=${filter[key]}`;
Expand Down
15 changes: 10 additions & 5 deletions src/components/Stakeholders/StakeholderDetail/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ function StakeholderList({ id, data, type, linked }) {

const handleChange = (e, data) => {
setIsLinked(!isLinked);
deleteStakeholder(id, {
type,
linked: !linked,
data: data,
});
const confirmed = window.confirm(
'Are you sure? Continuing will delete the stakeholder from the system.'
);
if (confirmed) {
deleteStakeholder(id, {
type,
linked: !linked,
data: data,
});
}
};

return (
Expand Down

0 comments on commit 1f9e811

Please sign in to comment.