⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.
TypeScript bookmarkbookmark-managercollaborationnextjsreact-nativeread-it-laterself-hostedtypescript
small improvements
Danielb07040a26f9d
diff --git a/components/Modal/Link/LinkDetails.tsx b/components/Modal/Link/LinkDetails.tsxindex c374aecc..3d182330 100644--- a/components/Modal/Link/LinkDetails.tsx+++ b/components/Modal/Link/LinkDetails.tsx@@ -131,7 +131,7 @@ export default function LinkDetails({ link }: Props) {height={42}alt=""id={"favicon-" + link.id}- className="select-none mt-2 rounded-full shadow border-[3px] border-white bg-white aspect-square"+ className="select-none mt-2 rounded-md shadow border-[3px] border-white bg-white aspect-square"draggable="false"onLoad={(e) => {try {diff --git a/lib/api/controllers/links/postLink.ts b/lib/api/controllers/links/postLink.tsindex 940e3189..ed04a899 100644--- a/lib/api/controllers/links/postLink.ts+++ b/lib/api/controllers/links/postLink.ts@@ -4,6 +4,7 @@ import getTitle from "@/lib/api/getTitle";import archive from "@/lib/api/archive";import { Collection, Link, UsersAndCollections } from "@prisma/client";import getPermission from "@/lib/api/getPermission";+import createFolder from "@/lib/api/storage/createFolder";export default async function postLink(link: LinkIncludingShortenedCollectionAndTags,@@ -14,7 +15,7 @@ export default async function postLink(if (!link.name) {return { response: "Please enter a valid name for the link.", status: 400 };} else if (!link.collection.name) {- return { response: "Please enter a valid collection.", status: 400 };+ link.collection.name = "Other";}if (link.collection.id) {@@ -83,6 +84,8 @@ export default async function postLink(include: { tags: true, collection: true },});+ createFolder({ filePath: `archives/${newLink.collectionId}` });+archive(newLink.url, newLink.collectionId, newLink.id);return { response: newLink, status: 200 };diff --git a/lib/api/storage/createFolder.ts b/lib/api/storage/createFolder.tsindex 18fc0d7e..7c2f0b0b 100644--- a/lib/api/storage/createFolder.ts+++ b/lib/api/storage/createFolder.ts@@ -4,7 +4,7 @@ import s3Client from "./s3Client";export default function createFolder({ filePath }: { filePath: string }) {if (s3Client) {- // Do nothing, S3 builds files recursively+ // Do nothing, S3 creates directories recursively} else {const storagePath = process.env.STORAGE_FOLDER;const creationPath = path.join(process.cwd(), storagePath + "/" + filePath);