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.

revert API changes

Kiran Kd7280e94533f
diff --git a/apps/web/app/api/links/count/route.ts b/apps/web/app/api/links/count/route.ts
index 3fbb0003b5..9b6f6e05bb 100644
--- a/apps/web/app/api/links/count/route.ts
+++ b/apps/web/app/api/links/count/route.ts
@@ -64,10 +64,7 @@ export const GET = withWorkspace(
}
const count = await getLinksCount({
- searchParams: {
- ...params,
- folderId,
- },
+ searchParams: params,
workspaceId: workspace.id,
folderIds,
});
diff --git a/apps/web/app/api/links/route.ts b/apps/web/app/api/links/route.ts
index a0587760d6..e8cd28748b 100644
--- a/apps/web/app/api/links/route.ts
+++ b/apps/web/app/api/links/route.ts
@@ -61,7 +61,6 @@ export const GET = withWorkspace(
const response = await getLinksForWorkspace({
...params,
workspaceId: workspace.id,
- folderId,
folderIds,
searchMode: selectedFolder?.type === "mega" ? "exact" : "fuzzy",
});
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/route.ts
index 1d911e49be..dcf0c945f5 100644
--- a/apps/web/app/api/workspaces/[idOrSlug]/route.ts
+++ b/apps/web/app/api/workspaces/[idOrSlug]/route.ts
@@ -65,7 +65,7 @@ export const GET = withWorkspace(
// PATCH /api/workspaces/[idOrSlug] – update a specific workspace by id or slug
export const PATCH = withWorkspace(
- async ({ req, workspace, session }) => {
+ async ({ req, workspace }) => {
const { name, slug, logo, conversionEnabled, allowedHostnames } =
await updateWorkspaceSchema.parseAsync(await parseRequestBody(req));
diff --git a/apps/web/lib/swr/use-links-count.ts b/apps/web/lib/swr/use-links-count.ts
index b5ccbf36b4..9e3661f334 100644
--- a/apps/web/lib/swr/use-links-count.ts
+++ b/apps/web/lib/swr/use-links-count.ts
@@ -20,7 +20,6 @@ export default function useLinksCount<T = any>({
} = {}) {
const { id: workspaceId } = useWorkspace();
const { getQueryString } = useRouterStuff();
- const { isMegaFolder } = useIsMegaFolder();
const [admin, setAdmin] = useState(false);
useEffect(() => {
@@ -28,6 +27,7 @@ export default function useLinksCount<T = any>({
setAdmin(true);
}
}, []);
+ const { isMegaFolder } = useIsMegaFolder();
const { data, error } = useSWR<any>(
workspaceId && !isMegaFolder && enabled
diff --git a/apps/web/lib/swr/use-links.ts b/apps/web/lib/swr/use-links.ts
index 35b71022a1..ee09c21ac0 100644
--- a/apps/web/lib/swr/use-links.ts
+++ b/apps/web/lib/swr/use-links.ts
@@ -15,8 +15,8 @@ export default function useLinks(
) {
const { id: workspaceId } = useWorkspace();
const { getQueryString } = useRouterStuff();
- const [admin, setAdmin] = useState(false);
+ const [admin, setAdmin] = useState(false);
useEffect(() => {
if (window.location.host.startsWith("admin.")) {
setAdmin(true);