({
isSubDomainRouting,
slug,
incrementId,
settings,
messageId,
LINEN_URL,
}: {
isSubDomainRouting: boolean;
slug?: string | null;
incrementId: number;
settings: {
communityName?: string;
redirectDomain?: string;
};
messageId?: string;
LINEN_URL: string;
})
| 40 | } |
| 41 | |
| 42 | export function getThreadUrl({ |
| 43 | isSubDomainRouting, |
| 44 | slug, |
| 45 | incrementId, |
| 46 | settings, |
| 47 | messageId, |
| 48 | LINEN_URL, |
| 49 | }: { |
| 50 | isSubDomainRouting: boolean; |
| 51 | slug?: string | null; |
| 52 | incrementId: number; |
| 53 | settings: { |
| 54 | communityName?: string; |
| 55 | redirectDomain?: string; |
| 56 | }; |
| 57 | messageId?: string; |
| 58 | LINEN_URL: string; |
| 59 | }) { |
| 60 | const slugLowerCase = (slug || 'topic').toLowerCase(); |
| 61 | const communityName = settings?.communityName; |
| 62 | const redirectDomain = settings?.redirectDomain; |
| 63 | |
| 64 | const threadLink = isSubDomainRouting |
| 65 | ? `https://${redirectDomain}/t/${incrementId}/${slugLowerCase}` |
| 66 | : `${LINEN_URL}/s/${communityName}/t/${incrementId}/${slugLowerCase}`; |
| 67 | |
| 68 | return `${threadLink}${!!messageId ? `#${messageId}` : ''}`; |
| 69 | } |
no outgoing calls
no test coverage detected