Skip to content

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

bug fixed

daniel31x13fa059d1b00ee
diff --git a/lib/api/controllers/links/postLink.ts b/lib/api/controllers/links/postLink.ts
index fab02b38..6e16b098 100644
--- a/lib/api/controllers/links/postLink.ts
+++ b/lib/api/controllers/links/postLink.ts
@@ -71,7 +71,9 @@ export default async function postLink(
};
}
- const { title, headers } = await fetchTitleAndHeaders(link.url || "");
+ const { title, headers } = link.url
+ ? await fetchTitleAndHeaders(link.url)
+ : {};
const name =
link.name && link.name !== "" ? link.name : link.url ? title : "";
diff --git a/lib/shared/schemaValidation.ts b/lib/shared/schemaValidation.ts
index 5df93042..76219633 100644
--- a/lib/shared/schemaValidation.ts
+++ b/lib/shared/schemaValidation.ts
@@ -119,9 +119,9 @@ export type PostLinkSchemaType = z.infer<typeof PostLinkSchema>;
export const UpdateLinkSchema = z.object({
id: z.number(),
- name: z.string().trim().max(2048).optional(),
- url: z.string().trim().max(2048).optional(),
- description: z.string().trim().max(2048).optional(),
+ name: z.string().trim().max(2048).nullish(),
+ url: z.string().trim().max(2048).nullish(),
+ description: z.string().trim().max(2048).nullish(),
icon: z.string().trim().max(50).nullish(),
iconWeight: z.string().trim().max(50).nullish(),
color: z.string().trim().max(10).nullish(),