Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unlinking bug fixed with removing an extra slash in uri #671

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions frontend/components/Viewing/Collection/Members.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ export default function Members(properties) {
setProcessedUri(theme.uriPrefix);
}
}

processUri();
return () => { isMounted = false };
}, [dispatch]);
Expand Down Expand Up @@ -336,16 +335,19 @@ function MemberTable(properties) {

const icon = compareUri(member.uri, `/${objectUriParts}`);

const removeTrailingSlash = (url) => {
return url.endsWith('/') ? url.slice(0, -1) : url;
};

const handleIconClick = (member) => {
if (icon && icon === faTrash) {
handleDelete(member);
} else if (icon && icon === faUnlink) {
handleUnlink(member, properties.processedUri); // Use processedUri from props
const processedUriPrefix = removeTrailingSlash(properties.processedUri);
handleUnlink(member, processedUriPrefix); // Use processedUri from props
}
};



const handleDelete = async (member) => {
if (member.uri && window.confirm("Would you like to remove this item from the collection?")) {
try {
Expand Down
Loading