bug fix + ux improvements

This commit is contained in:
Daniel
2023-08-22 00:43:34 -04:00
parent 09ea45eec0
commit acc974ecfe
8 changed files with 168 additions and 105 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ export default async function postLink(
}
if (!link.collection.name) {
link.collection.name = "Unnamed Collection";
link.collection.name = "Unorganized";
}
link.collection.name = link.collection.name.trim();
+6 -1
View File
@@ -35,8 +35,13 @@ export default async function updateLink(
link.collection.ownerId === userId &&
targetLink?.collection.ownerId === userId;
const authorizedSwitchCollection =
!isCollectionOwner && targetLink?.collection.id === link.collection.id;
console.log(authorizedSwitchCollection);
// Makes sure collection members (non-owners) cannot move a link to/from a collection.
if (!isCollectionOwner)
if (!authorizedSwitchCollection)
return {
response: "You can't move a link to/from a collection you don't own.",
status: 401,