Skip to content

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

fix(api): ensure sourceUrl is saved when creating asset bookmarks (#2574)

hoilceb976279e532
diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts
index fcf0f55f..89812ec9 100644
--- a/packages/trpc/routers/bookmarks.ts
+++ b/packages/trpc/routers/bookmarks.ts
@@ -254,7 +254,7 @@ export const bookmarksAppRouter = router({
content: null,
metadata: null,
fileName: input.fileName ?? null,
- sourceUrl: null,
+ sourceUrl: input.sourceUrl ?? null,
})
.returning();
const uploadedAsset = await Asset.fromId(ctx, input.assetId);
@@ -286,6 +286,8 @@ export const bookmarksAppRouter = router({
type: BookmarkTypes.ASSET,
assetType: asset.assetType,
assetId: asset.assetId,
+ fileName: asset.fileName,
+ sourceUrl: asset.sourceUrl,
};
break;
}