Skip to content

Commit

Permalink
Merge pull request #671 from SynBioHub/removeslashbug
Browse files Browse the repository at this point in the history
unlinking bug fixed with removing an extra slash in uri
  • Loading branch information
danielfang97 authored Jun 3, 2024
2 parents 7055ee5 + fac7af1 commit ee02edf
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 ee02edf

Please sign in to comment.