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.

account for empty list

Steven Tey7179320f76db
diff --git a/apps/web/lib/api/links.ts b/apps/web/lib/api/links.ts
index a0f1863471..4ae6d7a2d8 100644
--- a/apps/web/lib/api/links.ts
+++ b/apps/web/lib/api/links.ts
@@ -474,6 +474,7 @@ export async function addLink(link: LinkProps) {
}
export async function bulkCreateLinks(links: LinkProps[]) {
+ if (links.length === 0) return [];
const pipeline = redis.pipeline();
links.forEach(({ domain, key, url, expiresAt, password }) => {
const hasPassword = password && password.length > 0 ? true : false;