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.

Remove status codes from processLink

Kiran K24c740cf32ef
diff --git a/apps/web/lib/api/links.ts b/apps/web/lib/api/links.ts
index 763d4facdb..6a78192b01 100644
--- a/apps/web/lib/api/links.ts
+++ b/apps/web/lib/api/links.ts
@@ -275,7 +275,6 @@ export async function processLink({
return {
link: payload,
error: "Missing destination url.",
- status: 400,
code: "bad_request",
};
}
@@ -284,7 +283,6 @@ export async function processLink({
return {
link: payload,
error: "Invalid destination url.",
- status: 422,
code: "unprocessable_entity",
};
}
@@ -296,7 +294,6 @@ export async function processLink({
link: payload,
error:
"You can only use custom social media cards, password-protection, link cloaking, link expiration, device and geo targeting on a Pro plan and above. Upgrade to Pro to use these features.",
- status: 403,
code: "forbidden",
};
}
@@ -314,7 +311,6 @@ export async function processLink({
return {
link: payload,
error: "Invalid key.",
- status: 422,
code: "unprocessable_entity",
};
}
@@ -323,7 +319,6 @@ export async function processLink({
return {
link: payload,
error: "Invalid url.",
- status: 422,
code: "unprocessable_entity",
};
}
@@ -339,7 +334,6 @@ export async function processLink({
error: `Invalid url. You can only use ${domain} short links for URLs starting with ${allowedHostnames
.map((d) => `\`${d}\``)
.join(", ")}.`,
- status: 422,
code: "unprocessable_entity",
};
}
@@ -349,7 +343,6 @@ export async function processLink({
return {
link: payload,
error: "Domain does not belong to project.",
- status: 403,
code: "forbidden",
};
}
@@ -363,7 +356,6 @@ export async function processLink({
return {
link: payload,
error: "You cannot set custom social cards with bulk link creation.",
- status: 422,
code: "unprocessable_entity",
};
}
@@ -371,7 +363,6 @@ export async function processLink({
return {
link: payload,
error: "You cannot use link cloaking with bulk link creation.",
- status: 422,
code: "unprocessable_entity",
};
}
@@ -382,7 +373,6 @@ export async function processLink({
return {
link: payload,
error: `Link already exists.`,
- status: 409,
code: "conflict",
};
}
@@ -419,7 +409,6 @@ export async function processLink({
return {
link: payload,
error: "Missing Cloudinary environment variable.",
- status: 400,
code: "bad_request",
};
}
@@ -431,7 +420,6 @@ export async function processLink({
return {
link: payload,
error: "Invalid expiry date. Expiry date must be in ISO-8601 format.",
- status: 422,
code: "unprocessable_entity",
};
}
@@ -440,7 +428,6 @@ export async function processLink({
return {
link: payload,
error: "Expiry date must be in the future.",
- status: 422,
code: "unprocessable_entity",
};
}
@@ -465,7 +452,6 @@ export async function processLink({
}),
},
error: null,
- status: 200,
};
}