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 addLink bug

Steven Tey5255e9983ca4
diff --git a/components/app/add-link-modal.tsx b/components/app/add-link-modal.tsx
index b88860bd6b..2c673ceabe 100644
--- a/components/app/add-link-modal.tsx
+++ b/components/app/add-link-modal.tsx
@@ -45,8 +45,6 @@ function AddLinkModal({
url: "",
title: "",
timestamp: Date.now(),
- description: "",
- image: "",
});
const { key, url, title } = data;
@@ -331,7 +329,6 @@ function AdvancedSettings({ data, setData, debouncedUrl }) {
},
[setData]
);
- console.log(image);
return (
<div>
diff --git a/lib/swr/use-project.ts b/lib/swr/use-project.ts
index 5e3092447e..0a73e8f7cf 100644
--- a/lib/swr/use-project.ts
+++ b/lib/swr/use-project.ts
@@ -11,7 +11,7 @@ export default function useProject() {
};
const { data: project, error } = useSWR<ProjectProps>(
- router.isReady && `/api/projects/${slug}`,
+ slug && `/api/projects/${slug}`,
fetcher
);
diff --git a/pages/api/links/index.ts b/pages/api/links/index.ts
index 0fffe98f3d..96363450ee 100644
--- a/pages/api/links/index.ts
+++ b/pages/api/links/index.ts
@@ -23,7 +23,15 @@ export default async function handler(
if (!url) {
return res.status(400).json({ error: "Missing url" });
}
- const response = await addLink("dub.sh", url, key, title, session.user.id);
+ const response = await addLink(
+ "dub.sh",
+ url,
+ key,
+ title,
+ undefined,
+ undefined,
+ session.user.id
+ );
if (response === null) {
return res.status(400).json({ error: "Key already exists" });
}