Skip to content
Snippets Groups Projects
Commit ad6ff4b6 authored by Philippe Larose's avatar Philippe Larose
Browse files

jams-react-client: Handle revoked contact

Fixes holes in the contact list where contact that are revoked user where still attempted to be
displayed
Ticket: https://redmine.savoirfairelinux.com/issues/7449

Change-Id: Ib3fddf6c4b24bbd90e30d15b00c45cb306443bec
parent 8988640b
No related branches found
No related tags found
No related merge requests found
......@@ -193,22 +193,33 @@ export default function Users(props: UsersProps) {
null,
null
)
).then((response) => {
contact.username = response.data.name;
axios(
configApiCall(
api_path_get_user_profile + contact.username,
"GET",
null,
null
)
.then((response) => {
contact.username = response.data.name;
axios(
configApiCall(
api_path_get_user_profile + contact.username,
"GET",
null,
null
)
)
).then((response) => {
contact.profilePicture = response.data.profilePicture;
contact.firstName = response.data.firstName;
contact.lastName = response.data.lastName;
contact.organization = response.data.organization;
.then((response) => {
contact.profilePicture = response.data.profilePicture;
contact.firstName = response.data.firstName;
contact.lastName = response.data.lastName;
contact.organization = response.data.organization;
})
.catch(() => {
// If this point is reached, it means we have a contact that no longer has a profile
// This can happen if the user is removed from the LDAP/AD server
originalContacts.splice(originalContacts.indexOf(contact), 1);
});
})
.catch(() => {
// If this point is reached, it means we have a contact that is no longer part of the nameserver
originalContacts.splice(originalContacts.indexOf(contact), 1);
});
});
}
setContacts(originalContacts);
setLoading(false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment