bug fix + ux improvements
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user