Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fixed ts error

Steven Teyb1dfc1a185a9
diff --git a/components/app/links/links-container.tsx b/components/app/links/links-container.tsx
index 0008f1613b..a3026bd59c 100644
--- a/components/app/links/links-container.tsx
+++ b/components/app/links/links-container.tsx
@@ -7,7 +7,6 @@ import LinkSort from "./link-sort";
import useLinks from "#/lib/swr/use-links";
import { useLinkFiltersModal } from "../modals/link-filters-modal";
import LinkPagination from "./link-pagination";
-import { useEffect, useRef } from "react";
export default function LinksContainer({
AddEditLinkButton,
diff --git a/lib/swr/use-links.ts b/lib/swr/use-links.ts
index 3a3912b26b..8217218f97 100644
--- a/lib/swr/use-links.ts
+++ b/lib/swr/use-links.ts
@@ -2,19 +2,20 @@ import { useRouter } from "next/router";
import useSWR from "swr";
import { type Link as LinkProps } from "@prisma/client";
import { fetcher, getQueryString } from "#/lib/utils";
+import { UserProps } from "../types";
export default function useLinks() {
const router = useRouter();
- const { data: links, isValidating } = useSWR<LinkProps[]>(
- router.isReady && `/api/links${getQueryString(router)}`,
- fetcher,
- {
- // disable this because it keeps refreshing the state of the modal when its open
- revalidateOnFocus: false,
- dedupingInterval: 30000,
- },
- );
+ const { data: links, isValidating } = useSWR<
+ (LinkProps & {
+ user: UserProps;
+ })[]
+ >(router.isReady && `/api/links${getQueryString(router)}`, fetcher, {
+ // disable this because it keeps refreshing the state of the modal when its open
+ revalidateOnFocus: false,
+ dedupingInterval: 30000,
+ });
return {
links,