Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

fix: Fix browser bookmarking input schema

MohamedBassem9b7f9c14e604
diff --git a/packages/browser-extension/src/SavePage.tsx b/packages/browser-extension/src/SavePage.tsx
index e202aea5..2de19def 100644
--- a/packages/browser-extension/src/SavePage.tsx
+++ b/packages/browser-extension/src/SavePage.tsx
@@ -22,7 +22,7 @@ export default function SavePage({ settings }: { settings: Settings }) {
try {
const resp = await fetch(
- `${settings.address}/api/trpc/bookmarks.bookmarkLink`,
+ `${settings.address}/api/trpc/bookmarks.createBookmark`,
{
method: "POST",
headers: {
@@ -30,8 +30,10 @@ export default function SavePage({ settings }: { settings: Settings }) {
"Content-Type": "application/json",
},
body: JSON.stringify({
- type: "link",
- url: currentUrl,
+ json: {
+ type: "link",
+ url: currentUrl,
+ },
}),
},
);
diff --git a/packages/db/schema.ts b/packages/db/schema.ts
index 8d08282e..ea78a2b0 100644
--- a/packages/db/schema.ts
+++ b/packages/db/schema.ts
@@ -220,12 +220,9 @@ export const tagsOnBookmarksRelations = relations(
}),
);
-export const apiKeyRelations = relations(
- apiKeys,
- ({ one }) => ({
- user: one(users, {
- fields: [apiKeys.userId],
- references: [users.id],
- }),
+export const apiKeyRelations = relations(apiKeys, ({ one }) => ({
+ user: one(users, {
+ fields: [apiKeys.userId],
+ references: [users.id],
}),
-);
+}));