Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

bug fixed

daniel31x1392c7f40956a8
diff --git a/components/LinkViews/LinkMasonry.tsx b/components/LinkViews/LinkMasonry.tsx
index 369a004f..022ac938 100644
--- a/components/LinkViews/LinkMasonry.tsx
+++ b/components/LinkViews/LinkMasonry.tsx
@@ -177,7 +177,7 @@ export default function LinkMasonry({ link, flipDropdown, editMode }: Props) {
</p>
)}
- {link.tags[0] && (
+ {link.tags && link.tags[0] && (
<div className="flex gap-1 items-center flex-wrap">
{link.tags.map((e, i) => (
<Link
@@ -225,7 +225,7 @@ export default function LinkMasonry({ link, flipDropdown, editMode }: Props) {
</span>
)}
</p>
- {link.tags[0] && (
+ {link.tags && link.tags[0] && (
<>
<p className="text-neutral text-lg mt-3 font-semibold">
{t("tags")}
diff --git a/lib/api/controllers/links/linkId/updateLinkById.ts b/lib/api/controllers/links/linkId/updateLinkById.ts
index 4a24f4a3..306696ae 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,