Skip to content

Commit

Permalink
fix: Create dub links if valid url (#18588)
Browse files Browse the repository at this point in the history
* Create dub links if valid

* Map through filtered links

---------

Co-authored-by: Anik Dhabal Babu <[email protected]>
  • Loading branch information
joeauyeung and anikdhabal authored Jan 10, 2025
1 parent b652ae7 commit e7df1ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/features/ee/workflows/lib/reminders/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { dub } from "@calcom/features/auth/lib/dub";

export const bulkShortenLinks = async (links: string[]) => {
const results = await dub.links.createMany(links.map((link) => ({ domain: "sms.cal.com", url: link })));
const linksToShorten = links.filter((link) => link !== "");
const results = await dub.links.createMany(
linksToShorten.map((link) => ({ domain: "sms.cal.com", url: link }))
);

return links.map((link) => {
const createdLink = results.find((result) => result.url === link);
Expand Down

0 comments on commit e7df1ef

Please sign in to comment.