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.

fix missing domain error

Steven Teyde9b5de4a03e
diff --git a/lib/api/links.ts b/lib/api/links.ts
index bd85504b9c..da3fbd1796 100644
--- a/lib/api/links.ts
+++ b/lib/api/links.ts
@@ -214,8 +214,8 @@ export async function addLink(link: LinkProps) {
ios,
android,
},
+ // @ts-ignore
{
- // @ts-ignore
nx: true,
// if the key has an expiry, set exat
...(exat && { exat }),
diff --git a/pages/api/links/[key]/index.ts b/pages/api/links/[key]/index.ts
index d0d913f0d1..c1730b512e 100644
--- a/pages/api/links/[key]/index.ts
+++ b/pages/api/links/[key]/index.ts
@@ -24,9 +24,9 @@ export default withLinksAuth(
// PUT /api/links/:key – edit a link
} else if (req.method === "PUT") {
- let { key, url } = req.body;
- if (!key || !url) {
- return res.status(400).end("Missing key or url.");
+ let { domain, key, url } = req.body;
+ if (!domain || !key || !url) {
+ return res.status(400).end("Missing domain or key or url.");
}
if (!project) {
diff --git a/pages/api/links/index.ts b/pages/api/links/index.ts
index f076deb077..4b77d6445f 100644
--- a/pages/api/links/index.ts
+++ b/pages/api/links/index.ts
@@ -39,9 +39,9 @@ export default withLinksAuth(
// POST /api/links – create a new link
} else if (req.method === "POST") {
- let { key, url } = req.body;
- if (!key || !url) {
- return res.status(400).end("Missing key or url.");
+ let { domain, key, url } = req.body;
+ if (!domain || !key || !url) {
+ return res.status(400).end("Missing domain or key or url.");
}
// if it's not a custom project, do some filtering