diff --git a/components/LinkViews/LinkMasonry.tsx b/components/LinkViews/LinkMasonry.tsx index 369a004..022ac93 100644 --- a/components/LinkViews/LinkMasonry.tsx +++ b/components/LinkViews/LinkMasonry.tsx @@ -177,7 +177,7 @@ export default function LinkMasonry({ link, flipDropdown, editMode }: Props) {

)} - {link.tags[0] && ( + {link.tags && link.tags[0] && (
{link.tags.map((e, i) => ( )}

- {link.tags[0] && ( + {link.tags && link.tags[0] && ( <>

{t("tags")} diff --git a/lib/api/controllers/links/linkId/updateLinkById.ts b/lib/api/controllers/links/linkId/updateLinkById.ts index 4a24f4a..306696a 100644 --- a/lib/api/controllers/links/linkId/updateLinkById.ts +++ b/lib/api/controllers/links/linkId/updateLinkById.ts @@ -48,7 +48,7 @@ export default async function updateLinkById( }, }); - return { response: updatedLink, status: 200 }; + // return { response: updatedLink, status: 200 }; } const targetCollectionIsAccessible = await getPermission({ @@ -60,9 +60,6 @@ export default async function updateLinkById( (e: UsersAndCollections) => e.userId === userId && e.canUpdate ); - const targetCollectionsAccessible = - targetCollectionIsAccessible?.ownerId === userId; - const targetCollectionMatchesData = data.collection.id ? data.collection.id === targetCollectionIsAccessible?.id : true && data.collection.name @@ -71,12 +68,7 @@ export default async function updateLinkById( ? data.collection.ownerId === targetCollectionIsAccessible?.ownerId : true; - if (!targetCollectionsAccessible) - return { - response: "Target collection is not accessible.", - status: 401, - }; - else if (!targetCollectionMatchesData) + if (!targetCollectionMatchesData) return { response: "Target collection does not match the data.", status: 401,