Skip to content

Commit

Permalink
unlinking bug fixed with removing an extra slash in uri
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfang97 committed Jun 3, 2024
1 parent 7055ee5 commit fac7af1
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit fac7af1

Please sign in to comment.