Skip to content

Commit

Permalink
Imrpove user feedback for more actions
Browse files Browse the repository at this point in the history
  • Loading branch information
testower committed Dec 13, 2023
1 parent dba24af commit d927fcb
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/actions/OrganizationRegisterActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ OrganizationRegisterActions.createRole = role => async (dispatch, getState) => {
})
.catch(error => {
dispatch(sendData(types.ERROR_CREATE_PROVIDER, error));
dispatch(
SuppliersActions.addNotification('Error creating role', 'error')
);
console.log('Error creating role', error);
});
};

Expand All @@ -104,6 +108,9 @@ OrganizationRegisterActions.updateRole = role => async (dispatch, getState) => {
dispatch(OrganizationRegisterActions.getRoles());
})
.catch(error => {
dispatch(
SuppliersActions.addNotification('Error updating role', 'error')
);
console.log('Error updating role', error);
});
};
Expand Down Expand Up @@ -141,6 +148,10 @@ OrganizationRegisterActions.createOrganization = organization => async (
})
.catch(error => {
dispatch(sendData(types.FAILED_CREATING_ORGANIZATION, error));
dispatch(
SuppliersActions.addNotification('Error creating organization', 'error')
);
console.log('Error creating organization', error);
});
};

Expand All @@ -159,6 +170,9 @@ OrganizationRegisterActions.updateOrganization = organization => async (
dispatch(OrganizationRegisterActions.getOrganizations());
})
.catch(error => {
dispatch(
SuppliersActions.addNotification('Error updating organization', 'error')
);
console.log('Error updating organization', error);
});
};
Expand All @@ -179,6 +193,10 @@ OrganizationRegisterActions.updateUser = user => async (dispatch, getState) => {
dispatch(OrganizationRegisterActions.getUsers());
})
.catch(error => {
dispatch(sendData(types.FAILED_CREATING_USER, error));
dispatch(
SuppliersActions.addNotification('Error updating user', 'error')
);
console.log('Error updating user', error);
});
};
Expand Down Expand Up @@ -404,6 +422,10 @@ OrganizationRegisterActions.createUser = user => async (dispatch, getState) => {
})
.catch(error => {
dispatch(sendData(types.FAILED_CREATING_USER, error));
dispatch(
SuppliersActions.addNotification('Error creating user', 'error')
);
console.log('Error creating user', error);
});
};

Expand All @@ -424,6 +446,10 @@ OrganizationRegisterActions.createEntityType = entityType => async (
})
.catch(error => {
dispatch(sendData(types.FAILED_CREATING_ENTITY_TYPE, error));
dispatch(
SuppliersActions.addNotification('Error creating entity type', 'error')
);
console.log('Error creating entity type', error);
});
};

Expand All @@ -442,7 +468,10 @@ OrganizationRegisterActions.updateEntityType = entityType => async (
dispatch(OrganizationRegisterActions.getEntityTypes());
})
.catch(error => {
console.log('Error updating entity type set', error);
dispatch(
SuppliersActions.addNotification('Error updating entity type', 'error')
);
console.log('Error updating entity type', error);
});
};

Expand Down

0 comments on commit d927fcb

Please sign in to comment.