fix: return existing shortener if matching record already exists

This commit is contained in:
Arshdeep Singh 2025-06-02 10:55:08 +05:30
parent ee171da676
commit 0490664441

View file

@ -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,