From 0490664441e147ce1deee94b98da6c0685a85880 Mon Sep 17 00:00:00 2001 From: Arshdeep Singh Date: Mon, 2 Jun 2025 10:55:08 +0530 Subject: [PATCH] fix: return existing shortener if matching record already exists --- utils/helperFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/helperFunctions.js b/utils/helperFunctions.js index 2b4b914..a29db31 100644 --- a/utils/helperFunctions.js +++ b/utils/helperFunctions.js @@ -87,7 +87,7 @@ const createShortUrl = async ({ userId, customizedShortnerSlug ); - // if (existing) return existing.customized_shortner_slug || existing.short_code; + if (existing) return existing.customized_shortner_slug || existing.short_code; const shortCode = generateShortCode( longUrl,