From 0b769c3532551e9d0e7077703e4ea861a1179c66 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Tue, 8 Apr 2025 03:56:19 -0700 Subject: fix: Deprecate the updateBookmarkText trpc endpoint and replace it with updateBookmark --- packages/shared-react/hooks/bookmarks.ts | 15 --------------- packages/trpc/routers/bookmarks.ts | 3 ++- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'packages') diff --git a/packages/shared-react/hooks/bookmarks.ts b/packages/shared-react/hooks/bookmarks.ts index 7339f6c2..e06c7841 100644 --- a/packages/shared-react/hooks/bookmarks.ts +++ b/packages/shared-react/hooks/bookmarks.ts @@ -84,21 +84,6 @@ export function useUpdateBookmark( }); } -export function useUpdateBookmarkText( - ...opts: Parameters -) { - const apiUtils = api.useUtils(); - return api.bookmarks.updateBookmarkText.useMutation({ - ...opts[0], - onSuccess: (res, req, meta) => { - apiUtils.bookmarks.getBookmarks.invalidate(); - apiUtils.bookmarks.searchBookmarks.invalidate(); - apiUtils.bookmarks.getBookmark.invalidate({ bookmarkId: req.bookmarkId }); - return opts[0]?.onSuccess?.(res, req, meta); - }, - }); -} - export function useSummarizeBookmark( ...opts: Parameters ) { diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts index 9219adc6..5e6df4a5 100644 --- a/packages/trpc/routers/bookmarks.ts +++ b/packages/trpc/routers/bookmarks.ts @@ -473,7 +473,7 @@ export const bookmarksAppRouter = router({ .set({ text: input.text, }) - .where(eq(bookmarkLinks.id, input.bookmarkId)); + .where(eq(bookmarkTexts.id, input.bookmarkId)); if (result.changes == 0) { throw new TRPCError({ @@ -539,6 +539,7 @@ export const bookmarksAppRouter = router({ return updatedBookmark; }), + // DEPRECATED: use updateBookmark instead updateBookmarkText: authedProcedure .input( z.object({ -- cgit v1.2.3-70-g09d2