A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
fix: Deprecate the updateBookmarkText trpc endpoint and replace it with updateBookmark
MohamedBassem0b769c353255
diff --git a/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx b/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsxindex 98158ab1..e89d572d 100644--- a/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx+++ b/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx@@ -25,7 +25,7 @@ import { ClipboardList, Globe, Info, Tag, Trash2 } from "lucide-react-native";import {useDeleteBookmark,- useUpdateBookmarkText,+ useUpdateBookmark,} from "@hoarder/shared-react/hooks/bookmarks";import { BookmarkTypes, ZBookmark } from "@hoarder/shared/types/bookmarks";@@ -174,7 +174,7 @@ function BookmarkTextView({ bookmark }: { bookmark: ZBookmark }) {const initialText = bookmark.content.text;const [content, setContent] = useState(initialText);- const { mutate, isPending } = useUpdateBookmarkText({+ const { mutate, isPending } = useUpdateBookmark({onError: () => {toast({message: "Something went wrong",diff --git a/apps/web/components/dashboard/bookmarks/BookmarkMarkdownComponent.tsx b/apps/web/components/dashboard/bookmarks/BookmarkMarkdownComponent.tsxindex 60a6d634..9f7f2138 100644--- a/apps/web/components/dashboard/bookmarks/BookmarkMarkdownComponent.tsx+++ b/apps/web/components/dashboard/bookmarks/BookmarkMarkdownComponent.tsx@@ -3,7 +3,7 @@ import { MarkdownReadonly } from "@/components/ui/markdown/markdown-readonly";import { toast } from "@/components/ui/use-toast";import type { ZBookmarkTypeText } from "@hoarder/shared/types/bookmarks";-import { useUpdateBookmarkText } from "@hoarder/shared-react/hooks/bookmarks";+import { useUpdateBookmark } from "@hoarder/shared-react/hooks/bookmarks";export function BookmarkMarkdownComponent({children: bookmark,@@ -12,7 +12,7 @@ export function BookmarkMarkdownComponent({children: ZBookmarkTypeText;readOnly?: boolean;}) {- const { mutate: updateBookmarkMutator, isPending } = useUpdateBookmarkText({+ const { mutate: updateBookmarkMutator, isPending } = useUpdateBookmark({onSuccess: () => {toast({description: "Note updated!",diff --git a/packages/shared-react/hooks/bookmarks.ts b/packages/shared-react/hooks/bookmarks.tsindex 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<typeof api.bookmarks.updateBookmarkText.useMutation>-) {- 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<typeof api.bookmarks.summarizeBookmark.useMutation>) {diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.tsindex 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 insteadupdateBookmarkText: authedProcedure.input(z.object({