diff options
Diffstat (limited to 'packages/trpc')
| -rw-r--r-- | packages/trpc/routers/bookmarks.test.ts | 4 | ||||
| -rw-r--r-- | packages/trpc/routers/bookmarks.ts | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/packages/trpc/routers/bookmarks.test.ts b/packages/trpc/routers/bookmarks.test.ts index 9fcbec52..d6a7bc27 100644 --- a/packages/trpc/routers/bookmarks.test.ts +++ b/packages/trpc/routers/bookmarks.test.ts @@ -344,6 +344,7 @@ describe("Bookmark Routes", () => { test<CustomTestContext>("mutate assets", async ({ apiCallers, db }) => { const api = apiCallers[0].bookmarks; + const userId = await apiCallers[0].users.whoami().then((u) => u.id); const bookmark = await api.createBookmark({ url: "https://google.com", @@ -354,16 +355,19 @@ describe("Bookmark Routes", () => { id: "asset1", assetType: AssetTypes.LINK_SCREENSHOT, bookmarkId: bookmark.id, + userId, }), db.insert(assets).values({ id: "asset2", assetType: AssetTypes.LINK_BANNER_IMAGE, bookmarkId: bookmark.id, + userId, }), db.insert(assets).values({ id: "asset3", assetType: AssetTypes.LINK_FULL_PAGE_ARCHIVE, bookmarkId: bookmark.id, + userId, }), ]); diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts index 895e072a..b1491a61 100644 --- a/packages/trpc/routers/bookmarks.ts +++ b/packages/trpc/routers/bookmarks.ts @@ -853,6 +853,7 @@ export const bookmarksAppRouter = router({ id: input.asset.id, assetType: mapSchemaAssetTypeToDB(input.asset.assetType), bookmarkId: input.bookmarkId, + userId: ctx.user.id, }) .returning(); return input.asset; |
