Files
twenty/packages/twenty-shared/src/utils/url/getAbsoluteUrl.ts
T
Guillim 1cee587709 Removing trailing slashes (#12658)
Fix inconsistent domain URL formats : removing the last / that was
caused by URL method

Standardize URL formatting to ensure consistent links storage and
retrieval of domain URLs across the application. Will improve the
dedpulicates in the links

Note: there is another temporary issue from google that was solved on
the 13th of june https://groups.google.com/g/adwords-api/c/tRSQMRZrJYM
but we consider this out of this scope

Fixes #12621
2025-06-17 16:29:14 +02:00

13 lines
266 B
TypeScript

export const getAbsoluteUrl = (value: string): string => {
if (
value.startsWith('http://') ||
value.startsWith('https://') ||
value.startsWith('HTTPS://') ||
value.startsWith('HTTP://')
) {
return value;
}
return `https://${value}`;
};