Skip to content

Conversation

@ushahidlee
Copy link
Contributor

Change the visibility of the delete button, to allow a user to delete their own contact.

@linear
Copy link

linear bot commented Feb 12, 2024

canDeleteContact(contact: ContactsInterface) {
return contact.allowed_privileges?.includes('delete');
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The remove button & modal shows up for non-admin user @ushahidlee 👍🏼
But the response from the contacts API endpoint is a 403-forbidden for such user - images below.

Question: Is there a separate fix for this already on the backend that gives such users access and that one can test with yet?

Screenshot 2024-02-13 at 10 51 55

Screenshot 2024-02-13 at 10 53 03

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah there is a separate PR for backend.

ushahidi/platform#4716

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right then

canDeleteContact(contact: ContactsInterface) {
return contact.allowed_privileges?.includes('delete');
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right then

Copy link
Contributor

@Angamanga Angamanga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good 🙌

@ushahidlee ushahidlee merged commit 7525155 into development Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants