A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
refactor: fixed typos in BookmarkTypes (#268)
kamtschatka4e70fe34742a
diff --git a/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx b/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsxindex 87f115f9..f7421740 100644--- a/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx+++ b/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx@@ -47,7 +47,7 @@ export default function UpdatingBookmarkList({<BookmarkListbookmarks={data.pages.flatMap((p) => p.bookmarks)- .filter((b) => b.content.type != BookmarkTypes.UNKNWON)}+ .filter((b) => b.content.type != BookmarkTypes.UNKNOWN)}header={header}onRefresh={onRefresh}fetchNextPage={fetchNextPage}diff --git a/packages/shared/types/bookmarks.ts b/packages/shared/types/bookmarks.tsindex c0c12b56..e0118fe7 100644--- a/packages/shared/types/bookmarks.ts+++ b/packages/shared/types/bookmarks.ts@@ -8,7 +8,7 @@ export const enum BookmarkTypes {LINK = "link",TEXT = "text",ASSET = "asset",- UNKNWON = "unknown",+ UNKNOWN = "unknown",}export const zBookmarkedLinkSchema = z.object({@@ -45,7 +45,7 @@ export const zBookmarkContentSchema = z.discriminatedUnion("type", [zBookmarkedLinkSchema,zBookmarkedTextSchema,zBookmarkedAssetSchema,- z.object({ type: z.literal(BookmarkTypes.UNKNWON) }),+ z.object({ type: z.literal(BookmarkTypes.UNKNOWN) }),]);export type ZBookmarkContent = z.infer<typeof zBookmarkContentSchema>;diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.tsindex d0ffc7d3..1e5e7dfc 100644--- a/packages/trpc/routers/bookmarks.ts+++ b/packages/trpc/routers/bookmarks.ts@@ -178,7 +178,7 @@ function toZodSchema(bookmark: BookmarkQueryReturnType): ZBookmark {const { tagsOnBookmarks, link, text, asset, assets, ...rest } = bookmark;let content: ZBookmarkContent = {- type: BookmarkTypes.UNKNWON,+ type: BookmarkTypes.UNKNOWN,};switch (bookmark.type) {case BookmarkTypes.LINK:@@ -230,7 +230,7 @@ export const bookmarksAppRouter = router({return { ...alreadyExists, alreadyExists: true };}}- if (input.type == BookmarkTypes.UNKNWON) {+ if (input.type == BookmarkTypes.UNKNOWN) {throw new TRPCError({ code: "BAD_REQUEST" });}const bookmark = await ctx.db.transaction(async (tx) => {@@ -603,7 +603,7 @@ export const bookmarksAppRouter = router({if (row.bookmarkTags &&- // Duplicates may accur because of the join, so we need to make sure we're not adding the same tag twice+ // Duplicates may occur because of the join, so we need to make sure we're not adding the same tag twice!acc[bookmarkId].tags.some((t) => t.id == row.bookmarkTags!.id)) {invariant(