aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web/app
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-05 13:11:06 +0000
committerMohamedBassem <me@mbassem.com>2024-03-05 13:11:06 +0000
commit8a46ecb7373d6c5e7300861169ea51a7917cd2b4 (patch)
tree4ad318c3b5fc8b7a74cba6d0e37b6ade24db829a /packages/web/app
parent224aa38d5976523f213e2860b6addc7630d472ba (diff)
downloadkarakeep-8a46ecb7373d6c5e7300861169ea51a7917cd2b4.tar.zst
refactor: Extract trpc logic into its package
Diffstat (limited to 'packages/web/app')
-rw-r--r--packages/web/app/api/trpc/[trpc]/route.ts4
-rw-r--r--packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx2
-rw-r--r--packages/web/app/dashboard/bookmarks/components/BookmarkedTextEditor.tsx2
-rw-r--r--packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx2
-rw-r--r--packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx2
-rw-r--r--packages/web/app/dashboard/bookmarks/components/LinkCard.tsx2
-rw-r--r--packages/web/app/dashboard/bookmarks/components/TagList.tsx2
-rw-r--r--packages/web/app/dashboard/bookmarks/components/TagModal.tsx4
-rw-r--r--packages/web/app/dashboard/bookmarks/components/TextCard.tsx2
-rw-r--r--packages/web/app/dashboard/components/AllLists.tsx2
-rw-r--r--packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx2
-rw-r--r--packages/web/app/dashboard/lists/[listId]/components/ListView.tsx4
-rw-r--r--packages/web/app/dashboard/lists/components/AllListsView.tsx2
-rw-r--r--packages/web/app/signin/components/CredentialsForm.tsx2
14 files changed, 17 insertions, 17 deletions
diff --git a/packages/web/app/api/trpc/[trpc]/route.ts b/packages/web/app/api/trpc/[trpc]/route.ts
index 7d56cadc..b6753101 100644
--- a/packages/web/app/api/trpc/[trpc]/route.ts
+++ b/packages/web/app/api/trpc/[trpc]/route.ts
@@ -1,7 +1,7 @@
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
-import { appRouter } from "@/server/api/routers/_app";
+import { appRouter } from "@hoarder/trpc/routers/_app";
import { createContext } from "@/server/api/client";
-import { authenticateApiKey } from "@/server/auth";
+import { authenticateApiKey } from "@hoarder/trpc/auth";
import { db } from "@hoarder/db";
const handler = (req: Request) =>
diff --git a/packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx b/packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx
index 584e8708..4f08ebee 100644
--- a/packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/BookmarkOptions.tsx
@@ -2,7 +2,7 @@
import { useToast } from "@/components/ui/use-toast";
import { api } from "@/lib/trpc";
-import { ZBookmark, ZBookmarkedLink } from "@/lib/types/api/bookmarks";
+import { ZBookmark, ZBookmarkedLink } from "@hoarder/trpc/types/bookmarks";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
diff --git a/packages/web/app/dashboard/bookmarks/components/BookmarkedTextEditor.tsx b/packages/web/app/dashboard/bookmarks/components/BookmarkedTextEditor.tsx
index c449fae3..a5b58f1a 100644
--- a/packages/web/app/dashboard/bookmarks/components/BookmarkedTextEditor.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/BookmarkedTextEditor.tsx
@@ -1,4 +1,4 @@
-import { ZBookmark } from "@/lib/types/api/bookmarks";
+import { ZBookmark } from "@hoarder/trpc/types/bookmarks";
import {
Dialog,
DialogClose,
diff --git a/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx b/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx
index 62b93dc8..1ad3670c 100644
--- a/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/Bookmarks.tsx
@@ -1,6 +1,6 @@
import { redirect } from "next/navigation";
import BookmarksGrid from "./BookmarksGrid";
-import { ZGetBookmarksRequest } from "@/lib/types/api/bookmarks";
+import { ZGetBookmarksRequest } from "@hoarder/trpc/types/bookmarks";
import { api } from "@/server/api/client";
import { getServerAuthSession } from "@/server/auth";
diff --git a/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx b/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx
index 554d20a0..4d5b6b0a 100644
--- a/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx
@@ -1,7 +1,7 @@
"use client";
import LinkCard from "./LinkCard";
-import { ZBookmark, ZGetBookmarksRequest } from "@/lib/types/api/bookmarks";
+import { ZBookmark, ZGetBookmarksRequest } from "@hoarder/trpc/types/bookmarks";
import { api } from "@/lib/trpc";
import TextCard from "./TextCard";
import { Slot } from "@radix-ui/react-slot";
diff --git a/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx b/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx
index 5af11aa3..76d3f1b8 100644
--- a/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/LinkCard.tsx
@@ -8,7 +8,7 @@ import {
ImageCardFooter,
ImageCardTitle,
} from "@/components/ui/imageCard";
-import { ZBookmark } from "@/lib/types/api/bookmarks";
+import { ZBookmark } from "@hoarder/trpc/types/bookmarks";
import Link from "next/link";
import BookmarkOptions from "./BookmarkOptions";
import { api } from "@/lib/trpc";
diff --git a/packages/web/app/dashboard/bookmarks/components/TagList.tsx b/packages/web/app/dashboard/bookmarks/components/TagList.tsx
index 82d9f376..6c9d2d22 100644
--- a/packages/web/app/dashboard/bookmarks/components/TagList.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/TagList.tsx
@@ -1,7 +1,7 @@
import { badgeVariants } from "@/components/ui/badge";
import Link from "next/link";
import { Skeleton } from "@/components/ui/skeleton";
-import { ZBookmark } from "@/lib/types/api/bookmarks";
+import { ZBookmark } from "@hoarder/trpc/types/bookmarks";
import { cn } from "@/lib/utils";
export default function TagList({
diff --git a/packages/web/app/dashboard/bookmarks/components/TagModal.tsx b/packages/web/app/dashboard/bookmarks/components/TagModal.tsx
index 703c4221..8c09d00e 100644
--- a/packages/web/app/dashboard/bookmarks/components/TagModal.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/TagModal.tsx
@@ -11,8 +11,8 @@ import {
import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/use-toast";
import { api } from "@/lib/trpc";
-import { ZBookmark } from "@/lib/types/api/bookmarks";
-import { ZAttachedByEnum } from "@/lib/types/api/tags";
+import { ZBookmark } from "@hoarder/trpc/types/bookmarks";
+import { ZAttachedByEnum } from "@hoarder/trpc/types/tags";
import { cn } from "@/lib/utils";
import { Sparkles, X } from "lucide-react";
import { useState, KeyboardEvent, useEffect } from "react";
diff --git a/packages/web/app/dashboard/bookmarks/components/TextCard.tsx b/packages/web/app/dashboard/bookmarks/components/TextCard.tsx
index 029800ac..5e0ba3f9 100644
--- a/packages/web/app/dashboard/bookmarks/components/TextCard.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/TextCard.tsx
@@ -1,6 +1,6 @@
"use client";
-import { ZBookmark } from "@/lib/types/api/bookmarks";
+import { ZBookmark } from "@hoarder/trpc/types/bookmarks";
import BookmarkOptions from "./BookmarkOptions";
import { api } from "@/lib/trpc";
import { Maximize2, Star } from "lucide-react";
diff --git a/packages/web/app/dashboard/components/AllLists.tsx b/packages/web/app/dashboard/components/AllLists.tsx
index 8903c82a..a77252d0 100644
--- a/packages/web/app/dashboard/components/AllLists.tsx
+++ b/packages/web/app/dashboard/components/AllLists.tsx
@@ -5,7 +5,7 @@ import SidebarItem from "./SidebarItem";
import NewListModal, { useNewListModal } from "./NewListModal";
import { Plus } from "lucide-react";
import Link from "next/link";
-import { ZBookmarkList } from "@/lib/types/api/lists";
+import { ZBookmarkList } from "@hoarder/trpc/types/lists";
export default function AllLists({
initialData,
diff --git a/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx b/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx
index 32a7facf..5303b217 100644
--- a/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx
+++ b/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx
@@ -16,7 +16,7 @@ import { toast } from "@/components/ui/use-toast";
import { api } from "@/lib/trpc";
import { ActionButton } from "@/components/ui/action-button";
import { useState } from "react";
-import { ZBookmarkList } from "@/lib/types/api/lists";
+import { ZBookmarkList } from "@hoarder/trpc/types/lists";
export default function DeleteListButton({ list }: { list: ZBookmarkList }) {
const [isDialogOpen, setDialogOpen] = useState(false);
diff --git a/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx b/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx
index 6489e9f0..979b522f 100644
--- a/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx
+++ b/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx
@@ -1,8 +1,8 @@
"use client";
import BookmarksGrid from "@/app/dashboard/bookmarks/components/BookmarksGrid";
-import { ZBookmark } from "@/lib/types/api/bookmarks";
-import { ZBookmarkListWithBookmarks } from "@/lib/types/api/lists";
+import { ZBookmark } from "@hoarder/trpc/types/bookmarks";
+import { ZBookmarkListWithBookmarks } from "@hoarder/trpc/types/lists";
import { api } from "@/lib/trpc";
export default function ListView({
diff --git a/packages/web/app/dashboard/lists/components/AllListsView.tsx b/packages/web/app/dashboard/lists/components/AllListsView.tsx
index d81f5fca..0e2f898b 100644
--- a/packages/web/app/dashboard/lists/components/AllListsView.tsx
+++ b/packages/web/app/dashboard/lists/components/AllListsView.tsx
@@ -2,7 +2,7 @@
import { Button } from "@/components/ui/button";
import { api } from "@/lib/trpc";
-import { ZBookmarkList } from "@/lib/types/api/lists";
+import { ZBookmarkList } from "@hoarder/trpc/types/lists";
import { keepPreviousData } from "@tanstack/react-query";
import { Plus } from "lucide-react";
import Link from "next/link";
diff --git a/packages/web/app/signin/components/CredentialsForm.tsx b/packages/web/app/signin/components/CredentialsForm.tsx
index f47708f6..5296e163 100644
--- a/packages/web/app/signin/components/CredentialsForm.tsx
+++ b/packages/web/app/signin/components/CredentialsForm.tsx
@@ -13,7 +13,7 @@ import {
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { ActionButton } from "@/components/ui/action-button";
-import { zSignUpSchema } from "@/lib/types/api/users";
+import { zSignUpSchema } from "@hoarder/trpc/types/users";
import { signIn } from "next-auth/react";
import { useState } from "react";
import { api } from "@/lib/trpc";